Skip to content

Commit b1048a3

Browse files
committed
Change default to isObfuscated since we expect the precomputed api to mainly be used by clients
1 parent 8fe80dc commit b1048a3

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/client/eppo-precomputed-client.spec.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe('EppoPrecomputedClient E2E test', () => {
6969

7070
beforeAll(() => {
7171
storage.setEntries({ [precomputedFlagKey]: mockPrecomputedFlag });
72-
client = new EppoPrecomputedClient(storage);
72+
client = new EppoPrecomputedClient(storage, false);
7373
});
7474

7575
afterAll(() => {
@@ -89,7 +89,7 @@ describe('EppoPrecomputedClient E2E test', () => {
8989
it('Invokes logger for queued events', () => {
9090
const mockLogger = td.object<IAssignmentLogger>();
9191

92-
const client = new EppoPrecomputedClient(storage);
92+
const client = new EppoPrecomputedClient(storage, false);
9393
client.getStringAssignment(precomputedFlagKey, 'default-value');
9494
client.setAssignmentLogger(mockLogger);
9595

@@ -101,7 +101,7 @@ describe('EppoPrecomputedClient E2E test', () => {
101101
it('Does not log same queued event twice', () => {
102102
const mockLogger = td.object<IAssignmentLogger>();
103103

104-
const client = new EppoPrecomputedClient(storage);
104+
const client = new EppoPrecomputedClient(storage, false);
105105

106106
client.getStringAssignment(precomputedFlagKey, 'default-value');
107107
client.setAssignmentLogger(mockLogger);
@@ -112,7 +112,7 @@ describe('EppoPrecomputedClient E2E test', () => {
112112

113113
it('Does not invoke logger for events that exceed queue size', () => {
114114
const mockLogger = td.object<IAssignmentLogger>();
115-
const client = new EppoPrecomputedClient(storage);
115+
const client = new EppoPrecomputedClient(storage, false);
116116

117117
for (let i = 0; i < MAX_EVENT_QUEUE_SIZE + 100; i++) {
118118
client.getStringAssignment(precomputedFlagKey, 'default-value');
@@ -123,23 +123,23 @@ describe('EppoPrecomputedClient E2E test', () => {
123123
});
124124

125125
it('returns null if getStringAssignment was called for the subject before any precomputed flags were loaded', () => {
126-
const localClient = new EppoPrecomputedClient(new MemoryOnlyConfigurationStore());
126+
const localClient = new EppoPrecomputedClient(new MemoryOnlyConfigurationStore(), false);
127127
expect(localClient.getStringAssignment(precomputedFlagKey, 'hello world')).toEqual(
128128
'hello world',
129129
);
130130
expect(localClient.isInitialized()).toBe(false);
131131
});
132132

133133
it('returns default value when key does not exist', async () => {
134-
const client = new EppoPrecomputedClient(storage);
134+
const client = new EppoPrecomputedClient(storage, false);
135135
const nonExistentFlag = 'non-existent-flag';
136136
expect(client.getStringAssignment(nonExistentFlag, 'default')).toBe('default');
137137
});
138138

139139
it('logs variation assignment with correct metadata', () => {
140140
const mockLogger = td.object<IAssignmentLogger>();
141141
storage.setEntries({ [precomputedFlagKey]: mockPrecomputedFlag });
142-
const client = new EppoPrecomputedClient(storage);
142+
const client = new EppoPrecomputedClient(storage, false);
143143
client.setAssignmentLogger(mockLogger);
144144

145145
client.getStringAssignment(precomputedFlagKey, 'default');
@@ -160,7 +160,7 @@ describe('EppoPrecomputedClient E2E test', () => {
160160
td.when(mockLogger.logAssignment(td.matchers.anything())).thenThrow(new Error('logging error'));
161161

162162
storage.setEntries({ [precomputedFlagKey]: mockPrecomputedFlag });
163-
const client = new EppoPrecomputedClient(storage);
163+
const client = new EppoPrecomputedClient(storage, false);
164164
client.setAssignmentLogger(mockLogger);
165165

166166
const assignment = client.getStringAssignment(precomputedFlagKey, 'default');
@@ -175,7 +175,7 @@ describe('EppoPrecomputedClient E2E test', () => {
175175
beforeEach(() => {
176176
mockLogger = td.object<IAssignmentLogger>();
177177
storage.setEntries({ [precomputedFlagKey]: mockPrecomputedFlag });
178-
client = new EppoPrecomputedClient(storage);
178+
client = new EppoPrecomputedClient(storage, false);
179179
client.setAssignmentLogger(mockLogger);
180180
});
181181

@@ -457,7 +457,7 @@ describe('EppoPrecomputedClient E2E test', () => {
457457
}
458458
}
459459

460-
client = new EppoPrecomputedClient(new MockStore());
460+
client = new EppoPrecomputedClient(new MockStore(), false);
461461
client.setSubjectAndPrecomputedFlagsRequestParameters(requestParameters);
462462
// no configuration loaded
463463
let variation = client.getStringAssignment(precomputedFlagKey, 'default');
@@ -669,7 +669,7 @@ describe('EppoPrecomputedClient E2E test', () => {
669669
it('logs variation assignment with format from precomputed flags response', () => {
670670
const mockLogger = td.object<IAssignmentLogger>();
671671
storage.setEntries({ [precomputedFlagKey]: mockPrecomputedFlag });
672-
const client = new EppoPrecomputedClient(storage);
672+
const client = new EppoPrecomputedClient(storage, false);
673673
client.setAssignmentLogger(mockLogger);
674674

675675
client.getStringAssignment(precomputedFlagKey, 'default');
@@ -688,7 +688,7 @@ describe('EppoPrecomputedClient E2E test', () => {
688688
beforeEach(() => {
689689
store = new MemoryOnlyConfigurationStore<PrecomputedFlag>();
690690
mockLogger = td.object<IAssignmentLogger>();
691-
client = new EppoPrecomputedClient(store);
691+
client = new EppoPrecomputedClient(store, false);
692692
client.setAssignmentLogger(mockLogger);
693693
});
694694

src/client/eppo-precomputed-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default class EppoPrecomputedClient {
6666

6767
constructor(
6868
private precomputedFlagStore: IConfigurationStore<PrecomputedFlag>,
69-
private isObfuscated = false,
69+
private isObfuscated = true,
7070
) {}
7171

7272
public setIsObfuscated(isObfuscated: boolean) {

0 commit comments

Comments
 (0)