Skip to content

Commit 6b89ddf

Browse files
committed
fix(sdk-client): executeAfterTrack ordering
1 parent bfea9f3 commit 6b89ddf

11 files changed

Lines changed: 8 additions & 28 deletions

File tree

packages/sdk/browser/contract-tests/entity/src/ClientEntity.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,7 @@ function makeSdkConfig(options: SDKConfigParams, tag: string) {
190190
}
191191

192192
if (options.hooks) {
193-
cf.hooks = options.hooks.hooks.map(
194-
(hook) => new TestHook(hook.name, hook.callbackUri, hook.data, hook.errors),
195-
);
193+
cf.hooks = TestHook.forClient(options.hooks.hooks);
196194
}
197195

198196
cf.fetchGoals = false;

packages/sdk/browser/contract-tests/suppressions.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,4 @@ tags/stream requests/{"applicationId":"._-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL
1515
tags/stream requests/{"applicationId":"________________________________________________________________","applicationVersion":null}
1616
tags/stream requests/{"applicationId":"________________________________________________________________","applicationVersion":""}
1717
tags/stream requests/{"applicationId":"________________________________________________________________","applicationVersion":"._-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678"}
18-
tags/stream requests/{"applicationId":"________________________________________________________________","applicationVersion":"________________________________________________________________"}
19-
hooks/evaluation/executes beforeEvaluation hooks in registration order
20-
hooks/track/executes afterTrack hooks in registration order
18+
tags/stream requests/{"applicationId":"________________________________________________________________","applicationVersion":"________________________________________________________________"}

packages/sdk/electron/contract-tests/entity/src/ClientEntity.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ function makeSdkConfig(options: SDKConfigParams, tag: string) {
8787
}
8888

8989
if (options.hooks) {
90-
cf.hooks = options.hooks.hooks.map(
91-
(hook) => new TestHook(hook.name, hook.callbackUri, hook.data, hook.errors),
92-
);
90+
cf.hooks = TestHook.forClient(options.hooks.hooks);
9391
}
9492

9593
if (options.tls) {
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
hooks/evaluation/executes beforeEvaluation hooks in registration order
2-
hooks/track/executes afterTrack hooks in registration order

packages/sdk/react-native/contract-tests/entity/src/ClientEntity.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ function makeSdkConfig(options: SDKConfigParams, tag: string) {
7777
}
7878

7979
if (options.hooks) {
80-
cf.hooks = options.hooks.hooks.map(
81-
(hook) => new TestHook(hook.name, hook.callbackUri, hook.data, hook.errors),
82-
);
80+
cf.hooks = TestHook.forClient(options.hooks.hooks);
8381
}
8482

8583
return cf;

packages/sdk/react/contract-tests/app/ClientEntity.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ export function makeSdkConfig(options: SDKConfigParams, tag: string): LDOptions
7070
}
7171

7272
if (options.hooks) {
73-
cf.hooks = options.hooks.hooks.map(
74-
(hook) => new TestHook(hook.name, hook.callbackUri, hook.data, hook.errors),
75-
);
73+
cf.hooks = TestHook.forClient(options.hooks.hooks);
7674
}
7775

7876
cf.fetchGoals = false;

packages/sdk/react/contract-tests/suppressions.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,3 @@ tags/stream requests/{"applicationId":"_________________________________________
1616
tags/stream requests/{"applicationId":"________________________________________________________________","applicationVersion":""}
1717
tags/stream requests/{"applicationId":"________________________________________________________________","applicationVersion":"._-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678"}
1818
tags/stream requests/{"applicationId":"________________________________________________________________","applicationVersion":"________________________________________________________________"}
19-
hooks/evaluation/executes beforeEvaluation hooks in registration order
20-
hooks/track/executes afterTrack hooks in registration order

packages/sdk/server-node/contract-tests/testharness-suppressions-fdv2.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ streaming/fdv2/reconnection state management/replaces previously known state
1111
streaming/fdv2/reconnection state management/updates previously known state
1212
streaming/fdv2/ignores model version
1313
streaming/fdv2/can discard partial events on errors
14-
hooks/evaluation/executes beforeEvaluation hooks in registration order
15-
hooks/track/executes afterTrack hooks in registration order

packages/sdk/server-node/contract-tests/testharness-suppressions.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ streaming/validation/drop and reconnect if stream event has well-formed JSON not
33
streaming/requests/URL path is computed correctly/environment_filter_key="encoding_not_necessary"/base URI has no trailing slash/GET
44
streaming/requests/URL path is computed correctly/environment_filter_key="encoding_not_necessary"/base URI has a trailing slash/GET
55
polling/requests/URL path is computed correctly/environment_filter_key="encoding_not_necessary"/base URI has no trailing slash/GET
6-
polling/requests/URL path is computed correctly/environment_filter_key="encoding_not_necessary"/base URI has a trailing slash/GET
7-
hooks/evaluation/executes beforeEvaluation hooks in registration order
8-
hooks/track/executes afterTrack hooks in registration order
6+
polling/requests/URL path is computed correctly/environment_filter_key="encoding_not_necessary"/base URI has a trailing slash/GET

packages/shared/sdk-client/__tests__/hooks/HookRunner.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,6 @@ describe('given a hook runner and test hook', () => {
421421
expect(afterIdentifyOrder).toEqual(['c', 'b', 'a']);
422422

423423
// Verify track hooks order
424-
expect(afterTrackOrder).toEqual(['c', 'b', 'a']);
424+
expect(afterTrackOrder).toEqual(['a', 'b', 'c']);
425425
});
426426
});

0 commit comments

Comments
 (0)