Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6660d22
Merge pull request #111 from splitio/development
EmilianoSanchez May 24, 2024
29844ff
Upgrade JS SDK and vulnerability fixes
EmilianoSanchez Sep 5, 2024
cccc086
Update tests and polishing
EmilianoSanchez Sep 6, 2024
5cab1e2
Refactor splitReducer
EmilianoSanchez Sep 6, 2024
057d295
Use SDK client lastUpdate to set the property in the state
EmilianoSanchez Sep 6, 2024
9e8667d
Handle events of non-default clients
EmilianoSanchez Sep 6, 2024
94fd37a
Update status property in state
EmilianoSanchez Sep 6, 2024
a3fc06f
Make status property optional, to avoid an interface breaking change
EmilianoSanchez Sep 10, 2024
e49acdd
Update reducer unit tests
EmilianoSanchez Sep 10, 2024
792927d
Add custom Jest matcher to simplify unit tests
EmilianoSanchez Sep 10, 2024
a51613a
Merge pull request #115 from splitio/refactor_reducer_and_actions
EmilianoSanchez Sep 10, 2024
385443c
Merge branch 'refactor_reducer_and_actions' into add_shared_clients_s…
EmilianoSanchez Sep 10, 2024
8913f07
Rename test file to match src file
EmilianoSanchez Sep 10, 2024
22dc49f
Unit tests: assert dispatched actions
EmilianoSanchez Sep 10, 2024
e0ced35
Merge branch 'status_properties_update' into add_shared_clients_statu…
EmilianoSanchez Sep 10, 2024
20ae830
Fix test
EmilianoSanchez Sep 10, 2024
96eb777
Update SPLIT_READY_WITH_EVALUATIONS action to handle default and non-…
EmilianoSanchez Sep 11, 2024
917fabf
rc
EmilianoSanchez Sep 11, 2024
269c4e9
Create isMainClient function to reuse as a util
EmilianoSanchez Sep 11, 2024
bfeae9f
Merge branch 'status_properties_update' into add_shared_clients_statu…
EmilianoSanchez Sep 11, 2024
8060bb7
Updated and selectors to retrieve status properties from the state …
EmilianoSanchez Sep 11, 2024
722e293
Fix typos
EmilianoSanchez Sep 11, 2024
98fb9bd
Merge branch 'status_properties_update' into add_shared_clients_statu…
EmilianoSanchez Sep 11, 2024
470c3ec
rc
EmilianoSanchez Sep 11, 2024
b434883
Add selectStatus selector
EmilianoSanchez Sep 12, 2024
54db7c2
stable version
EmilianoSanchez Sep 12, 2024
eac0e6b
Merge pull request #116 from splitio/add_shared_clients_status_to_state
EmilianoSanchez Sep 12, 2024
2103250
Add ISplitAction type
EmilianoSanchez Sep 12, 2024
b9c6bf9
Merge branch 'status_properties_update' into add_selectStatus
EmilianoSanchez Sep 12, 2024
bd8c52f
Update type definition comments
EmilianoSanchez Sep 12, 2024
d728b47
Export remaining types
EmilianoSanchez Sep 12, 2024
0677eeb
Fix some links
EmilianoSanchez Sep 12, 2024
c7433a3
Fix export
EmilianoSanchez Sep 12, 2024
0747866
Merge pull request #117 from splitio/add_selectStatus
EmilianoSanchez Sep 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.14.0 (September XX, 2024)
- Added `lastUpdate` and `isTimedout` properties to the object returned by the `getStatus` helper and `selectTreatmentAndStatus` and `selectTreatmentWithConfigAndStatus` selectors, to expose the last event timestamp and the timedout status of the SDK clients (Related to https://github.com/splitio/redux-client/issues/113).
- Updated @splitsoftware/splitio package to version 10.28.0 that includes minor updates:
- Added `sync.requestOptions.getHeaderOverrides` configuration option to enhance SDK HTTP request Headers for Authorization Frameworks.
- Updated some transitive dependencies for vulnerability fixes.

1.13.0 (May 24, 2024)
- Added a new `getStatus` helper function to retrieve the status properties of the SDK manager and clients: `isReady`, `isReadyFromCache`, `hasTimedout`, and `isDestroyed`.
- Added new `selectTreatmentAndStatus` and `selectTreatmentWithConfigAndStatus` selectors as alternatives to the `selectTreatmentValue` and `selectTreatmentWithConfig` selectors, respectively.
Expand Down
121 changes: 51 additions & 70 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
"homepage": "https://github.com/splitio/redux-client#readme",
"dependencies": {
"@splitsoftware/splitio": "10.26.0",
"@splitsoftware/splitio": "10.28.0",
"tslib": "^2.3.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/helpers.browser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ describe('getStatus', () => {
(splitSdk.factory as any).client('user_2').__emitter__.emit(Event.SDK_READY_FROM_CACHE);

// Main client
const MAIN_CLIENT_STATUS = { ...STATUS_INITIAL, isReady: true, isOperational: true };
const MAIN_CLIENT_STATUS = { ...STATUS_INITIAL, isReady: true, isOperational: true, lastUpdate: (splitSdk.factory.client() as any).__getStatus().lastUpdate };
expect(getStatus()).toEqual(MAIN_CLIENT_STATUS);
expect(getStatus(sdkBrowserConfig.core.key)).toEqual(MAIN_CLIENT_STATUS);
expect(getStatus({ matchingKey: sdkBrowserConfig.core.key as string, bucketingKey: '' })).toEqual(MAIN_CLIENT_STATUS);

// Client for user_2
const USER_2_STATUS = { ...STATUS_INITIAL, isReadyFromCache: true, isOperational: true };
const USER_2_STATUS = { ...STATUS_INITIAL, isReadyFromCache: true, isOperational: true, lastUpdate: (splitSdk.factory.client('user_2') as any).__getStatus().lastUpdate };
expect(getStatus('user_2')).toEqual(USER_2_STATUS);
expect(getStatus({ matchingKey: 'user_2', bucketingKey: '' })).toEqual(USER_2_STATUS);

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/helpers.node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ describe('getStatus', () => {
initSplitSdk({ config: sdkNodeConfig });
(splitSdk.factory as any).client().__emitter__.emit(Event.SDK_READY);

const MAIN_CLIENT_STATUS = { ...STATUS_INITIAL, isReady: true, isOperational: true };
const MAIN_CLIENT_STATUS = { ...STATUS_INITIAL, isReady: true, isOperational: true, lastUpdate: (splitSdk.factory.client() as any).__getStatus().lastUpdate };
expect(getStatus()).toEqual(MAIN_CLIENT_STATUS);
expect(getStatus('ignored_key_in_server_side')).toEqual(MAIN_CLIENT_STATUS);
});
Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/selectorsWithStatus.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('selectTreatmentAndStatus & selectTreatmentWithConfigAndStatus', () =>
expect(selectTreatmentAndStatus(STATE_INITIAL.splitio, SPLIT_1)).toEqual({
treatment: CONTROL,
// status of main client:
...STATUS_INITIAL, isReady: true, isOperational: true,
...STATUS_INITIAL, isReady: true, isOperational: true, lastUpdate: (splitSdk.factory.client() as any).__getStatus().lastUpdate,
});

expect(selectTreatmentAndStatus(STATE_INITIAL.splitio, SPLIT_1, USER_1, 'some_value')).toEqual({
Expand All @@ -67,7 +67,7 @@ describe('selectTreatmentAndStatus & selectTreatmentWithConfigAndStatus', () =>
expect(selectTreatmentWithConfigAndStatus(STATE_INITIAL.splitio, SPLIT_2, USER_1)).toEqual({
treatment: CONTROL_WITH_CONFIG,
// status of shared client:
...STATUS_INITIAL, isReadyFromCache: true, isOperational: true,
...STATUS_INITIAL, isReadyFromCache: true, isOperational: true, lastUpdate: (splitSdk.factory.client(USER_1) as any).__getStatus().lastUpdate,
});

expect(errorSpy).not.toHaveBeenCalled();
Expand All @@ -85,13 +85,13 @@ describe('selectTreatmentAndStatus & selectTreatmentWithConfigAndStatus', () =>
expect(selectTreatmentAndStatus(STATE_READY.splitio, SPLIT_1)).toEqual({
treatment: ON,
...STATUS_INITIAL,
isReady: true, isOperational: true,
isReady: true, isOperational: true, lastUpdate: (splitSdk.factory.client() as any).__getStatus().lastUpdate
});

expect(selectTreatmentWithConfigAndStatus(STATE_READY.splitio, SPLIT_2, USER_1)).toEqual({
treatment: STATE_READY.splitio.treatments[SPLIT_2][USER_1],
...STATUS_INITIAL,
isReadyFromCache: true, isOperational: true,
isReadyFromCache: true, isOperational: true, lastUpdate: (splitSdk.factory.client(USER_1) as any).__getStatus().lastUpdate
});

expect(errorSpy).not.toHaveBeenCalled();
Expand Down
Loading