Commit 58e063b
authored
ci: fixing contract test breaking due to async hooks (#1391)
BEGIN_COMMIT_OVERRIDE
ci: fixing contract test breaking due to async hooks
fix(sdk-client): `executeAfterTrack` ordering
END_COMMIT_OVERRIDE
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes runtime hook invocation order for afterTrack (a behavioral API
contract); impact is limited to apps using multiple track hooks, but
ordering semantics are intentional for harness alignment.
>
> **Overview**
> Fixes contract-test hook ordering failures by aligning
**`afterTrack`** execution with registration order and serializing
harness callback posts.
>
> In **`HookRunner`**, **`executeAfterTrack`** now iterates hooks
forward (same as **`beforeEvaluation`** / **`beforeIdentify`**) instead
of reverse like **`afterEvaluation`**. **`HookRunner`** unit
expectations for track hook order are updated accordingly.
>
> Contract-test **`TestHook`** instances now share a **`HookPostQueue`**
via **`TestHook.forClient`**, chaining async **`fetch`** callbacks so
the harness sees stable arrival order; **`BaseTestHook`** routes
evaluation/track posts through **`enqueuePost`**. Browser, Electron,
React, React Native, and server-node contract entities use the factory.
Hook-order-related lines are removed from several **`suppressions.txt`**
files now that behavior matches the harness.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
6b89ddf. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 7c73024 commit 58e063b
16 files changed
Lines changed: 50 additions & 35 deletions
File tree
- packages
- sdk
- browser/contract-tests
- entity/src
- electron/contract-tests
- entity/src
- react-native/contract-tests/entity/src
- react/contract-tests
- app
- server-node/contract-tests
- src
- tooling/contract-test-utils/src
- client-side
- server-side
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
195 | | - | |
| 193 | + | |
196 | 194 | | |
197 | 195 | | |
198 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 90 | + | |
93 | 91 | | |
94 | 92 | | |
95 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
| 80 | + | |
83 | 81 | | |
84 | 82 | | |
85 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 73 | + | |
76 | 74 | | |
77 | 75 | | |
78 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
| 91 | + | |
94 | 92 | | |
95 | 93 | | |
96 | 94 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 6 | + | |
0 commit comments