Commit d72f2f2
committed
fix(test-utils): Use server time for listener registration, not client time
The listener was using the client's timestamp from the query param, but
due to network latency, events could be buffered between when the client
generated its timestamp and when the HTTP request reached the server.
Timeline of the bug:
1. Client: T1 = 1000ms (generates timestamp)
2. Client: Sends HTTP request with ?timestamp=1000
3. [NETWORK DELAY]
4. Previous test's event arrives at proxy at T2 = 1002ms (buffered!)
5. Server receives HTTP request at T3 = 1003ms
7. Buffer check: 1002 > 1000 = TRUE → stale event passes!
Fix: Use the server's current time when the listener is actually
registered. This ensures we only receive events that arrived AFTER
the listener was registered on the server.1 parent bae7fb6 commit d72f2f2
1 file changed
+6
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| |||
0 commit comments