Skip to content

Commit 8847e72

Browse files
Fix SplitsCacheInMemory::clear method, to clear flag sets cache
1 parent 2083e00 commit 8847e72

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/storages/inMemory/SplitsCacheInMemory.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export class SplitsCacheInMemory extends AbstractSplitsCacheSync {
2424
this.ttCache = {};
2525
this.changeNumber = -1;
2626
this.segmentsCount = 0;
27+
this.flagSetsCache = {};
2728
}
2829

2930
addSplit(split: ISplit): boolean {

src/storages/inMemory/__tests__/SplitsCacheInMemory.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ test('SPLITS CACHE / In Memory / flag set cache tests', () => {
161161

162162
cache.addSplit(featureFlagWithoutFS);
163163
expect(cache.getNamesByFlagSets([])).toEqual([]);
164+
165+
cache.clear();
166+
expect(cache.getNamesByFlagSets(['o', 'e', 'x'])).toEqual([emptySet, emptySet, emptySet]);
164167
});
165168

166169
// if FlagSets are not defined, it should store all FlagSets in memory.

0 commit comments

Comments
 (0)