Skip to content

Commit e33101b

Browse files
Merge branch 'development' into SDKS-8407_baseline
2 parents d2fbd1b + cefdec9 commit e33101b

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

CHANGES.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
2.0.0 (September XX, 2024)
2-
- Added `factory.destroy()` method, which invokes the `destroy` method on all SDK clients created by the factory.
32
- Added support for targeting rules based on large segments.
3+
- Added `factory.destroy()` method, which invokes the `destroy` method on all SDK clients created by the factory.
4+
- Bugfixing - Fixed an issue with the server-side polling manager that caused dangling timers when the SDK was destroyed before it was ready.
45
- BREAKING CHANGES:
56
- Updated default flag spec version to 1.2.
67
- Removed `/mySegments` endpoint from SplitAPI module, as it is replaced by `/memberships` endpoint.

src/__tests__/testUtils/fetchMock.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// http://www.wheresrhys.co.uk/fetch-mock/#usageinstallation
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
23
import fetchMockLib from 'fetch-mock';
34

45
const fetchMock = fetchMockLib.sandbox();

src/sync/polling/pollingManagerSS.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { splitsSyncTaskFactory } from './syncTasks/splitsSyncTask';
22
import { segmentsSyncTaskFactory } from './syncTasks/segmentsSyncTask';
33
import { IPollingManager, ISegmentsSyncTask, ISplitsSyncTask } from './types';
4-
import { thenable } from '../../utils/promise/thenable';
54
import { POLLING_START, POLLING_STOP, LOG_PREFIX_SYNC_POLLING } from '../../logger/constants';
65
import { ISdkFactoryContextSync } from '../../sdkFactory/types';
76

@@ -29,9 +28,9 @@ export function pollingManagerSSFactory(
2928
log.debug(LOG_PREFIX_SYNC_POLLING + `Segments will be refreshed each ${settings.scheduler.segmentsRefreshRate} millis`);
3029

3130
const startingUp = splitsSyncTask.start();
32-
if (thenable(startingUp)) {
31+
if (startingUp) {
3332
startingUp.then(() => {
34-
segmentsSyncTask.start();
33+
if (splitsSyncTask.isRunning()) segmentsSyncTask.start();
3534
});
3635
}
3736
},

0 commit comments

Comments
 (0)