Commit de2a2e0
test(tanstackstart): Deterministically match the server-side error event (#22137)
The tanstackstart server-function error test flaked: it asserted the
error's mechanism is `auto.middleware.tanstackstart.server_function`,
but occasionally received
`auto.browser.global_handlers.onunhandledrejection` instead.
_Root cause_: the thrown error propagates back to the client over the
server-function RPC and is captured a second time on the client as an
`onunhandledrejection` with the **same message**. The `waitForError`
predicate matched on message only, so it raced the two events and
sometimes resolved with the client-side duplicate.
The predicate now also matches the server mechanism, so the correct
server-side event is always selected. The same latent race exists in the
API-route test (identical message-only predicate + specific-mechanism
assertion), so that predicate is hardened the same way.
Fixes #21912
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent c845ae9 commit de2a2e0
1 file changed
Lines changed: 13 additions & 2 deletions
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
47 | 53 | | |
48 | 54 | | |
49 | 55 | | |
| |||
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
77 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
78 | 89 | | |
79 | 90 | | |
80 | 91 | | |
| |||
0 commit comments