Skip to content

Commit 910818e

Browse files
docs(SDK-555): clarify deprecated encryption docs and precedence test
Align encryptionEnforced JSDoc with keychainEncryption defaults and assert explicit keychainEncryption wins over encryptionEnforced in toDict(). Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 24cf9ad commit 910818e

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

‎src/core/classes/Iterable.test.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,14 +386,23 @@ describe('Iterable', () => {
386386
expect(configDict.keychainEncryption).toBe(false);
387387
});
388388

389-
it('should keep keychainEncryption enabled when only deprecated encryptionEnforced is set', () => {
389+
it('should still serialize encrypted keychain when only deprecated encryptionEnforced is set', () => {
390390
const config = new IterableConfig();
391391
config.encryptionEnforced = true;
392392
const configDict = config.toDict();
393393
expect(config.keychainEncryption).toBe(true);
394394
expect(configDict.keychainEncryption).toBe(true);
395395
expect(configDict.encryptionEnforced).toBe(true);
396396
});
397+
398+
it('should prefer keychainEncryption over deprecated encryptionEnforced in toDict()', () => {
399+
const config = new IterableConfig();
400+
config.keychainEncryption = false;
401+
config.encryptionEnforced = true;
402+
const configDict = config.toDict();
403+
expect(configDict.keychainEncryption).toBe(false);
404+
expect(configDict.encryptionEnforced).toBe(true);
405+
});
397406
});
398407

399408
describe('urlHandler', () => {

‎src/core/classes/IterableConfig.ts‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,10 @@ export class IterableConfig {
331331
keychainEncryption = true;
332332

333333
/**
334-
* @deprecated Use {@link IterableConfig.keychainEncryption} instead. This field is still serialized for
335-
* back-compat on Android when `keychainEncryption` is absent from the bridge payload.
336-
*
337-
* Android only feature: This controls whether the SDK should enforce encryption for all PII stored on disk.
338-
* By default, the SDK will not enforce encryption and may fallback to unencrypted storage in case the encryption fails.
334+
* @deprecated Use {@link IterableConfig.keychainEncryption} instead. Android honors
335+
* `keychainEncryption` (default `true`, encrypted). This field is still serialized so
336+
* older bridge payloads that omit `keychainEncryption` can fall back when
337+
* `encryptionEnforced` is `true`; it does not disable encryption when left `false`.
339338
*/
340339
encryptionEnforced = false;
341340

0 commit comments

Comments
 (0)