Skip to content

chore: support running multiple clients with same client id#1253

Draft
joker23 wants to merge 3 commits intomainfrom
skz/sdk-1907/electron-multi-env
Draft

chore: support running multiple clients with same client id#1253
joker23 wants to merge 3 commits intomainfrom
skz/sdk-1907/electron-multi-env

Conversation

@joker23
Copy link
Copy Markdown
Contributor

@joker23 joker23 commented Apr 7, 2026

This PR will implement support for running multiple LDClients with the same mobile key. We do this by adding an optional namespace option 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 namespace option 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 in ElectronPlatform and contract tests, and (b) scope IPC channel registration in ElectronClient plus renderer bridge initialization via ElectronRendererClient/createRendererClient.

Updates validation to accept namespace, exports deriveNamespace from the package, adjusts contract-test client creation to assign unique namespaces, and refactors/extends tests (shared mock logger helper, parameterized variation tests, new ElectronIPC unit 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.


Open with Devin

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25661 bytes
Compressed size limit: 29000
Uncompressed size: 126143 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 31736 bytes
Compressed size limit: 34000
Uncompressed size: 112937 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179348 bytes
Compressed size limit: 200000
Uncompressed size: 830127 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 37181 bytes
Compressed size limit: 38000
Uncompressed size: 204409 bytes

@joker23 joker23 force-pushed the skz/sdk-1907/electron-multi-env branch 3 times, most recently from 4c9b14f to 5809629 Compare April 8, 2026 17:57
@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented Apr 8, 2026

@cursor review

cursor[bot]

This comment was marked as resolved.

@joker23 joker23 force-pushed the skz/sdk-1907/electron-multi-env branch from 5809629 to cc53988 Compare April 8, 2026 19:28
@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented Apr 8, 2026

@cursor review

cursor[bot]

This comment was marked as resolved.

@joker23 joker23 force-pushed the skz/sdk-1907/electron-multi-env branch from cc53988 to 9ce11d7 Compare April 8, 2026 20:06
@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented Apr 8, 2026

@cursor review

cursor[bot]

This comment was marked as resolved.

@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented Apr 8, 2026

@cursor review

cursor[bot]

This comment was marked as resolved.

@joker23 joker23 force-pushed the skz/sdk-1907/electron-multi-env branch from d81b6d3 to 846d62c Compare April 8, 2026 21:04
@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented Apr 8, 2026

@cursor review

cursor[bot]

This comment was marked as resolved.

@joker23 joker23 force-pushed the skz/sdk-1907/electron-multi-env branch from 846d62c to 3459aff Compare April 8, 2026 21:14
@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented Apr 8, 2026

@cursor review

@joker23 joker23 force-pushed the skz/sdk-1907/electron-multi-env branch from 3459aff to 909cbf5 Compare April 8, 2026 21:14
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@joker23 joker23 force-pushed the skz/sdk-1907/electron-multi-env branch from 6a561de to c211d00 Compare April 9, 2026 20:03
@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented Apr 9, 2026

@cursor review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@joker23 joker23 marked this pull request as ready for review April 9, 2026 20:37
@joker23 joker23 requested a review from a team as a code owner April 9, 2026 20:37
@joker23 joker23 force-pushed the skz/sdk-1907/electron-multi-env branch from c211d00 to 451f17d Compare April 9, 2026 20:40
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented Apr 9, 2026

This is the wrong implementation

@joker23 joker23 closed this Apr 9, 2026
@joker23 joker23 reopened this Apr 9, 2026
@joker23 joker23 marked this pull request as draft April 9, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant