Skip to content

Commit 846d62c

Browse files
committed
chore: bot comment
1 parent 9ce11d7 commit 846d62c

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

packages/sdk/electron/__tests__/ElectronIPC.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ it('derives namespace from credential alone', () => {
66
});
77

88
it('derives namespace from credential with custom namespace', () => {
9-
expect(deriveNamespace('mob-abc-123', 'my-namespace')).toBe('my-namespace:mob-abc-123');
9+
expect(deriveNamespace('mob-abc-123', 'my-namespace')).toBe('my-namespace_mob-abc-123');
1010
});
1111

1212
it('produces different namespaces with and without custom namespace', () => {

packages/sdk/electron/src/deriveNamespace.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
* preserving backward compatibility for single-client apps.
66
*/
77
export function deriveNamespace(credential: string, customNamespace?: string): string {
8-
return customNamespace ? `${customNamespace}:${credential}` : credential;
8+
return customNamespace ? `${customNamespace}_${credential}` : credential;
99
}

packages/sdk/electron/src/platform/ElectronPlatform.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ export default class ElectronPlatform implements platform.Platform {
2222
requests: platform.Requests;
2323

2424
constructor(logger: LDLogger, derivedNamespace: string, options: ElectronOptions) {
25-
this.storage = new ElectronStorage(derivedNamespace, logger);
25+
const storageNs = this.crypto
26+
.createHash('sha256')
27+
.update(derivedNamespace)
28+
.digest?.('base64url');
29+
this.storage = new ElectronStorage(storageNs!, logger);
2630
this.requests = new ElectronRequests(
2731
options.tlsParams,
2832
options.proxyOptions,

0 commit comments

Comments
 (0)