Skip to content

Commit

Permalink
Merge branch 'SDKS-8407_baseline' into refactor_storage_emits_ready_f…
Browse files Browse the repository at this point in the history
…rom_cache
  • Loading branch information
EmilianoSanchez committed Oct 4, 2024
2 parents cf822b9 + e33101b commit 6af7ee0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
2.0.0 (September XX, 2024)
- Updated internal storage factory to emit the SDK_READY_FROM_CACHE event when it corresponds, to clean up the initialization flow.
- Added `factory.destroy()` method, which invokes the `destroy` method on all SDK clients created by the factory.
2.0.0 (October XX, 2024)
- Added support for targeting rules based on large segments.
- Added `factory.destroy()` method, which invokes the `destroy` method on all SDK clients created by the factory.
- Updated internal storage factory to emit the SDK_READY_FROM_CACHE event when it corresponds, to clean up the initialization flow.
- Bugfixing - Fixed an issue with the server-side polling manager that caused dangling timers when the SDK was destroyed before it was ready.
- BREAKING CHANGES:
- Updated default flag spec version to 1.2.
- Removed `/mySegments` endpoint from SplitAPI module, as it is replaced by `/memberships` endpoint.
Expand Down
3 changes: 2 additions & 1 deletion src/__tests__/testUtils/fetchMock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// http://www.wheresrhys.co.uk/fetch-mock/#usageinstallation
// @TODO upgrade fetch-mock when fetch-mock-jest vulnerabilities are fixed
// https://www.wheresrhys.co.uk/fetch-mock/docs/fetch-mock/Usage/cheatsheet#local-fetch-with-jest
import fetchMockLib from 'fetch-mock';

const fetchMock = fetchMockLib.sandbox();
Expand Down
5 changes: 2 additions & 3 deletions src/sync/polling/pollingManagerSS.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { splitsSyncTaskFactory } from './syncTasks/splitsSyncTask';
import { segmentsSyncTaskFactory } from './syncTasks/segmentsSyncTask';
import { IPollingManager, ISegmentsSyncTask, ISplitsSyncTask } from './types';
import { thenable } from '../../utils/promise/thenable';
import { POLLING_START, POLLING_STOP, LOG_PREFIX_SYNC_POLLING } from '../../logger/constants';
import { ISdkFactoryContextSync } from '../../sdkFactory/types';

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

const startingUp = splitsSyncTask.start();
if (thenable(startingUp)) {
if (startingUp) {
startingUp.then(() => {
segmentsSyncTask.start();
if (splitsSyncTask.isRunning()) segmentsSyncTask.start();
});
}
},
Expand Down

0 comments on commit 6af7ee0

Please sign in to comment.