Skip to content

Commit 26d1467

Browse files
Merge pull request #106 from splitio/update_localstorage_clear
Update LocalStorage to clear storage if SDK key or filter criteria change #779
2 parents f27bd40 + 56ad4ea commit 26d1467

8 files changed

Lines changed: 69 additions & 50 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") npm run build
4848

4949
- name: Store assets
50-
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/SDKS-7797-flagsets_in_pluggable_storage' || github.ref == 'refs/heads/main') }}
50+
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/main') }}
5151
uses: actions/upload-artifact@v3
5252
with:
5353
name: assets
@@ -58,7 +58,7 @@ jobs:
5858
name: Upload assets
5959
runs-on: ubuntu-20.04
6060
needs: build
61-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/SDKS-7797-flagsets_in_pluggable_storage' }}
61+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }}
6262
strategy:
6363
matrix:
6464
environment:

CHANGES.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
0.13.0 (December XX, 2023)
1+
0.13.0 (December 12, 2023)
22
- Added support for Flag Sets in "consumer" and "partial consumer" modes (pluggable storage).
3-
- Updated @splitsoftware/splitio-commons package to version 1.12.0 that includes flag sets support for "consumer" and "partial consumer" modes, and other improvements.
3+
- Updated SDK cache for browsers using localStorage, to clear cached feature flag definitions before initiating the synchronization process, if the cache was previously synchronized with a different SDK key (i.e., a different environment) or different Split Filter criteria.
4+
- Updated @splitsoftware/splitio-commons package to version 1.12.1 that includes flag sets support for consumer modes, and other improvements.
45
- Bugfixing - Fixed manager methods in consumer modes to return results in a promise when the SDK is not operational (not ready or destroyed).
56

67
0.12.0 (November 3, 2023)

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio-browserjs",
3-
"version": "0.13.0-rc.1",
3+
"version": "0.13.0",
44
"description": "Split SDK for JavaScript on Browser",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",
@@ -64,7 +64,7 @@
6464
"bugs": "https://github.com/splitio/javascript-browser-client/issues",
6565
"homepage": "https://github.com/splitio/javascript-browser-client#readme",
6666
"dependencies": {
67-
"@splitsoftware/splitio-commons": "1.12.0",
67+
"@splitsoftware/splitio-commons": "1.12.1",
6868
"@types/google.analytics": "0.0.40",
6969
"unfetch": "^4.2.0"
7070
},

src/__tests__/browserSuites/push-corner-cases.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { getStorageHash } from '@splitsoftware/splitio-commons/src/storages/KeyBuilder';
12
import splitChangesMock1 from '../mocks/splitchanges.since.-1.json';
23
import splitKillMessage from '../mocks/message.SPLIT_KILL.1457552650000.json';
34
import authPushEnabledNicolas from '../mocks/auth.pushEnabled.nicolas@split.io.json';
@@ -46,6 +47,7 @@ export function testSplitKillOnReadyFromCache(fetchMock, assert) {
4647

4748
// prepare localstorage to allow SPLIT_KILL kill locally
4849
localStorage.clear();
50+
localStorage.setItem('pushCornerCase.SPLITIO.hash', getStorageHash(settings));
4951
localStorage.setItem('pushCornerCase.SPLITIO.splits.till', 25);
5052
localStorage.setItem('pushCornerCase.SPLITIO.split.whitelist', JSON.stringify({
5153
'name': 'whitelist',

0 commit comments

Comments
 (0)