Skip to content

Commit 62741e8

Browse files
Polishing
1 parent 28c4b1b commit 62741e8

File tree

5 files changed

+7
-33
lines changed

5 files changed

+7
-33
lines changed

CHANGES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- Updated the handling of timers and async operations inside an `init` factory method to enable lazy initialization of the SDK in standalone mode. This update is intended for the React SDK.
66
- Bugfixing - Fixed an issue with the server-side polling manager that caused dangling timers when the SDK was destroyed before it was ready.
77
- BREAKING CHANGES:
8-
- Updated default flag spec version to 1.2.
8+
- Updated default flag spec version to 1.2, which requires Split Proxy v5.9.0 or higher.
99
- Removed `/mySegments` endpoint from SplitAPI module, as it is replaced by `/memberships` endpoint.
1010
- Removed support for MY_SEGMENTS_UPDATE and MY_SEGMENTS_UPDATE_V2 notification types, as they are replaced by MEMBERSHIPS_MS_UPDATE and MEMBERSHIPS_LS_UPDATE notification types.
1111
- Removed the deprecated `GOOGLE_ANALYTICS_TO_SPLIT` and `SPLIT_TO_GOOGLE_ANALYTICS` integrations.

src/__tests__/testUtils/fetchMock.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// @TODO upgrade fetch-mock when fetch-mock-jest vulnerabilities are fixed
2-
// https://www.wheresrhys.co.uk/fetch-mock/docs/fetch-mock/Usage/cheatsheet#local-fetch-with-jest
1+
// @TODO upgrade fetch-mock to fix vulnerabilities
32
import fetchMockLib from 'fetch-mock';
43

54
const fetchMock = fetchMockLib.sandbox();

src/readiness/readinessManager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function splitsEventEmitterFactory(EventEmitter: new () => SplitIO.IEventEmitter
88
const splitsEventEmitter = objectAssign(new EventEmitter(), {
99
splitsArrived: false,
1010
splitsCacheLoaded: false,
11-
initialized: false,
11+
hasInit: false,
1212
initCallbacks: []
1313
});
1414

@@ -68,7 +68,7 @@ export function readinessManagerFactory(
6868

6969
let readyTimeoutId: ReturnType<typeof setTimeout>;
7070
if (readyTimeout > 0) {
71-
if (splits.initialized) readyTimeoutId = setTimeout(timeout, readyTimeout);
71+
if (splits.hasInit) readyTimeoutId = setTimeout(timeout, readyTimeout);
7272
else splits.initCallbacks.push(() => { readyTimeoutId = setTimeout(timeout, readyTimeout); });
7373
}
7474

@@ -137,8 +137,8 @@ export function readinessManagerFactory(
137137
setDestroyed() { isDestroyed = true; },
138138

139139
init() {
140-
if (splits.initialized) return;
141-
splits.initialized = true;
140+
if (splits.hasInit) return;
141+
splits.hasInit = true;
142142
splits.initCallbacks.forEach(cb => cb());
143143
},
144144

src/readiness/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface ISplitsEventEmitter extends SplitIO.IEventEmitter {
1313
once(event: ISplitsEvent, listener: (...args: any[]) => void): this;
1414
splitsArrived: boolean
1515
splitsCacheLoaded: boolean
16-
initialized: boolean,
16+
hasInit: boolean,
1717
initCallbacks: (() => void)[]
1818
}
1919

temp.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)