Commit 3fe51c9
authored
[Flight] Use more robust web socket implementation in fixture (facebook#34338)
The `WebSocketStream` implementation seems to be a bit unreliable. We've
seen `Cannot close a ERRORED writable stream` errors when expanding the
logged deep object, for example. And when reducing the fixture to a
minimal app, we even get `Connection closed` errors, because the web
socket connection is closed before all debug chunks are sent.
We can improve the reliability of the web socket connection by using a
normal `WebSocket` instance on the client, along with manually creating
a `WritableStream` and a `ReadableStream` for processing the messages.
As an additional benefit, the debug channel now also works in Firefox
and Safari.
On the server, we're simplifying the integration with the Express server
a bit by utilizing the `server` property for `WebSocket.Server`, instead
of the `noServer` property with the manual upgrade handling.1 parent 4082b0e commit 3fe51c9
2 files changed
+61
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 77 | + | |
84 | 78 | | |
85 | 79 | | |
86 | 80 | | |
| |||
132 | 126 | | |
133 | 127 | | |
134 | 128 | | |
135 | | - | |
| 129 | + | |
136 | 130 | | |
137 | 131 | | |
138 | 132 | | |
| |||
385 | 379 | | |
386 | 380 | | |
387 | 381 | | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
406 | 397 | | |
407 | 398 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
17 | 55 | | |
18 | 56 | | |
19 | 57 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 58 | + | |
24 | 59 | | |
25 | | - | |
26 | | - | |
| 60 | + | |
| 61 | + | |
27 | 62 | | |
28 | | - | |
29 | 63 | | |
30 | 64 | | |
31 | 65 | | |
| |||
74 | 108 | | |
75 | 109 | | |
76 | 110 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 111 | + | |
81 | 112 | | |
82 | | - | |
83 | | - | |
| 113 | + | |
| 114 | + | |
84 | 115 | | |
85 | | - | |
86 | 116 | | |
87 | 117 | | |
88 | 118 | | |
| |||
0 commit comments