Skip to content

Commit 68f82fd

Browse files
General polishing
1 parent a9b10db commit 68f82fd

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@
343343
- Updated readiness events on consumer mode: the SDK emits SDK_READY event once the connection to Redis cache is successful.
344344
- Updated streamingEnabled default value from false to true, to use streaming synchronization by default.
345345
- Removed the use of Promise.prototype.finally to avoid issues with some promise polyfills.
346+
- Bugfix - Always emit SDK_READY and SDK_READY_FROM_CACHE events asynchronously, ensuring that listeners attached after client instantiation are invoked.
346347

347348
10.12.1 (May 18, 2020)
348349
- Updated logging messages for streaming notifications to DEBUG log level.

src/__tests__/nodeSuites/impressions.spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ export default async function (key, fetchMock, assert) {
5252
assert.equal(data.length, 3, 'We performed evaluations for 4 features, but one with `impressionsDisabled` true, so we should have 3 items total.');
5353

5454
// finding these validate the feature names collection too
55-
const dependencyChildImpr = data.filter(e => e.f === 'hierarchical_splits_test')[0];
56-
const splitWithConfigImpr = data.filter(e => e.f === 'split_with_config')[0];
57-
const notExistentSplitImpr = data.filter(e => e.f === 'not_existent_split')[0];
58-
const alwaysOnWithImpressionsDisabledTrue = data.filter(e => e.f === 'always_on_impressions_disabled_true');
55+
const dependencyChildImpr = data.find(e => e.f === 'hierarchical_splits_test');
56+
const splitWithConfigImpr = data.find(e => e.f === 'split_with_config');
57+
const notExistentSplitImpr = data.find(e => e.f === 'not_existent_split');
58+
const alwaysOnWithImpressionsDisabledTrue = data.find(e => e.f === 'always_on_impressions_disabled_true');
5959

6060
assert.equal(notExistentSplitImpr.i.length, 1); // Only one, the split not found is filtered by the non existent Split check.
6161
assert.equal(splitWithConfigImpr.i.length, 3);
6262
assert.equal(dependencyChildImpr.i.length, 1);
63-
assert.equal(alwaysOnWithImpressionsDisabledTrue.length, 0);
63+
assert.equal(alwaysOnWithImpressionsDisabledTrue, undefined);
6464

6565
assert.true(dependencyChildImpr, 'Split we wanted to evaluate should be present on the impressions.');
6666
assert.false(data.some(e => e.f === 'hierarchical_dep_always_on'), 'Parent split evaluations should not result in impressions.');
@@ -115,8 +115,8 @@ export default async function (key, fetchMock, assert) {
115115
assert.equal(data.pf.length, 2, 'We should generate impression count for 2 features.');
116116

117117
// finding these validate the feature names collection too
118-
const splitWithConfigImpr = data.pf.filter(e => e.f === 'split_with_config')[0];
119-
const alwaysOnWithImpressionsDisabledTrue = data.pf.filter(e => e.f === 'always_on_impressions_disabled_true')[0];
118+
const splitWithConfigImpr = data.pf.find(e => e.f === 'split_with_config');
119+
const alwaysOnWithImpressionsDisabledTrue = data.pf.find(e => e.f === 'always_on_impressions_disabled_true');
120120

121121
assert.equal(splitWithConfigImpr.rc, 1);
122122
assert.equal(typeof splitWithConfigImpr.m, 'number');

0 commit comments

Comments
 (0)