You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGES.txt
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
1.1.0 (January XX, 2025)
2
+
- Added two new configuration options for the SDK's `InLocalStorage` module to control the behavior of the persisted rollout plan cache in the browser:
3
+
- `expirationDays` to specify the validity period of the rollout plan cache in days.
4
+
- `clearOnInit` to clear the rollout plan cache on SDK initialization.
5
+
- Updated @splitsoftware/splitio-commons package to version 2.1.0.
6
+
1
7
1.0.1 (November 11, 2024)
2
8
- Bugfixing - Revert removal of TypeScript `SplitIO` namespace at `/types/splitio.d.ts` to allow explicit imports of types from the Browser SDK package. E.g., `import type { IClientSideSettings } from '@splitsoftware/splitio-browserjs/types/splitio';`.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,4 +83,4 @@ For a comprehensive list of open source projects visit our [Github page](https:/
83
83
84
84
**Learn more about Split:**
85
85
86
-
Visit [split.io/product](https://www.split.io/product) for an overview of Split, or visit our documentation at [help.split.io](http://help.split.io) for more detailed information.
86
+
Visit [split.io/product](https://www.split.io/product) for an overview of Split, or visit our documentation at [help.split.io](https://help.split.io) for more detailed information.
localStorage.setItem('readyFromCache_4.SPLITIO.splits.lastUpdated',Date.now()-DEFAULT_CACHE_EXPIRATION_IN_MILLIS-1);// -1 to ensure having an expired lastUpdated item
392
+
localStorage.setItem('readyFromCache_4.SPLITIO.splits.lastUpdated',Date.now()-DEFAULT_CACHE_EXPIRATION_IN_MILLIS/10-1);// -1 to ensure having an expired lastUpdated item
t.true(console.log.calledWithMatch('clearOnInit was set and cache was not cleared in the last 24 hours. Cleaning up cache'),'It should log a message about cleaning up cache');
819
+
820
+
client.once(client.Event.SDK_READY_FROM_CACHE,()=>t.fail('It should not emit SDK_READY_FROM_CACHE because clearOnInit is true.'));
821
+
822
+
awaitclient.ready();
823
+
t.equal(manager.names().sort().length,32,'active splits should be present for evaluation');
824
+
825
+
awaitsplitio.destroy();
826
+
t.equal(localStorage.getItem('readyFromCache_10.SPLITIO.splits.till'),'1457552620999','splits.till must correspond to the till of the last successfully fetched Splits');
827
+
t.equal(localStorage.getItem('readyFromCache_10.SPLITIO.hash'),expectedHashNullFilter,'Storage hash must not be changed');
828
+
t.true(nearlyEqual(parseInt(localStorage.getItem('readyFromCache_10.SPLITIO.lastClear')),Date.now()),'lastClear timestamp must be set');
829
+
830
+
// Start again with cached data and lastClear item within the last 24 hours -> no cache cleanup
t.equal(manager.names().sort().length,32,'active splits should be present for evaluation');
841
+
t.false(console.log.calledWithMatch('clearOnInit was set and cache was not cleared in the last 24 hours. Cleaning up cache'),'It should log a message about cleaning up cache');
842
+
843
+
awaitsplitio.destroy();
844
+
845
+
// Start again with cached data and lastClear item older than 24 hours -> cache cleanup
846
+
console.log.resetHistory();
847
+
localStorage.setItem('readyFromCache_10.SPLITIO.lastClear',Date.now()-25*60*60*1000);// 25 hours ago
t.equal(manager.names().sort().length,32,'active splits should be present for evaluation');
860
+
t.true(console.log.calledWithMatch('clearOnInit was set and cache was not cleared in the last 24 hours. Cleaning up cache'),'It should log a message about cleaning up cache');
0 commit comments