Commit f135e04
fix: capture WebSocket error messages before close (#552)
* fix: capture WebSocket error messages before close
The close frame's reason field is unreliable through proxies (often
arrives as code=1006, reason=None). Fix:
Client-side (cloud_connection.py):
- Capture 'error' type messages and store in _last_close_reason
- Now when close event fires, we have the real error from the message
Server-side (fal_app.py):
- Add 100ms delay between sending error and closing connection
- Helps ensure error message is flushed before close frame
Signed-off-by: livepeer-robot <robot@livepeer.org>
* fix: don't overwrite error message reason with close frame's None
The close handler was overwriting _last_close_reason with the close
frame's reason (usually None through proxies), losing the error message
we captured earlier.
Now:
1. Error message arrives → _last_close_reason = 'Access denied: ...'
2. Close event arrives → keep existing reason, don't overwrite with None
3. UI toast shows the real error instead of 'reason: None'
Signed-off-by: livepeer-robot <robot@livepeer.org>
* Dont show previous connection errors and verify userID against API
Signed-off-by: Max Holland <max@livepeer.org>
---------
Signed-off-by: livepeer-robot <robot@livepeer.org>
Signed-off-by: Max Holland <max@livepeer.org>
Co-authored-by: livepeer-robot <robot@livepeer.org>
Co-authored-by: Max Holland <max@livepeer.org>1 parent 9cdaca9 commit f135e04
3 files changed
Lines changed: 63 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
44 | 52 | | |
| 53 | + | |
45 | 54 | | |
46 | 55 | | |
47 | 56 | | |
48 | 57 | | |
49 | 58 | | |
50 | 59 | | |
51 | 60 | | |
52 | | - | |
| 61 | + | |
53 | 62 | | |
54 | 63 | | |
55 | 64 | | |
56 | 65 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
35 | 56 | | |
36 | 57 | | |
37 | 58 | | |
| |||
425 | 446 | | |
426 | 447 | | |
427 | 448 | | |
428 | | - | |
429 | | - | |
430 | | - | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
431 | 452 | | |
432 | 453 | | |
433 | 454 | | |
| |||
728 | 749 | | |
729 | 750 | | |
730 | 751 | | |
731 | | - | |
| 752 | + | |
732 | 753 | | |
733 | 754 | | |
734 | 755 | | |
| 756 | + | |
| 757 | + | |
735 | 758 | | |
736 | 759 | | |
737 | 760 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
293 | 293 | | |
294 | | - | |
| 294 | + | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
301 | 307 | | |
302 | 308 | | |
303 | | - | |
| 309 | + | |
304 | 310 | | |
305 | 311 | | |
306 | 312 | | |
307 | 313 | | |
308 | 314 | | |
309 | | - | |
| 315 | + | |
310 | 316 | | |
311 | 317 | | |
312 | 318 | | |
| |||
332 | 338 | | |
333 | 339 | | |
334 | 340 | | |
335 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
336 | 352 | | |
| 353 | + | |
337 | 354 | | |
338 | 355 | | |
339 | 356 | | |
340 | 357 | | |
341 | 358 | | |
342 | 359 | | |
343 | 360 | | |
344 | | - | |
345 | 361 | | |
346 | 362 | | |
347 | 363 | | |
| |||
0 commit comments