chore: support running multiple clients with same client id#1253
chore: support running multiple clients with same client id#1253
Conversation
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk-common size report |
4c9b14f to
5809629
Compare
|
@cursor review |
5809629 to
cc53988
Compare
|
@cursor review |
cc53988 to
9ce11d7
Compare
|
@cursor review |
|
@cursor review |
d81b6d3 to
846d62c
Compare
|
@cursor review |
846d62c to
3459aff
Compare
|
@cursor review |
3459aff to
909cbf5
Compare
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3459aff. Configure here.
6a561de to
c211d00
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c211d00. Configure here.
c211d00 to
451f17d
Compare
|
This is the wrong implementation |
This PR will implement support for running multiple LDClients with the same mobile key. We do this by adding an optional
namespaceoption that will prefix the persistent storage path so there won't be any collisions.This change is helpful in that we should provide a way to custom the namespaces for IPC connections.
Note
Medium Risk
Changes how storage keys and IPC channel names are derived, which can affect cache isolation and renderer/main communication for existing multi-client apps. Most changes are additive and covered by updated unit/contract tests, but misconfigured namespaces could still cause collisions or disconnected renderer clients.
Overview
Adds an optional
namespaceoption to allow multiple Electron SDK clients to run in the same process with the same credential without colliding on cache files or IPC handlers.Introduces
deriveNamespace()and uses the derived value to (a) hash storage filenames inElectronPlatformand contract tests, and (b) scope IPC channel registration inElectronClientplus renderer bridge initialization viaElectronRendererClient/createRendererClient.Updates validation to accept
namespace, exportsderiveNamespacefrom the package, adjusts contract-test client creation to assign unique namespaces, and refactors/extends tests (shared mock logger helper, parameterized variation tests, newElectronIPCunit tests, and migration docs explaining namespacing).Reviewed by Cursor Bugbot for commit 451f17d. Bugbot is set up for automated code reviews on this repo. Configure here.