Commit a7ff626
ClashFX Team
fix: reconnect traffic/log websocket on clean disconnect
The disconnect handler previously early-returned when error was nil,
silently swallowing every clean close (sleep/wake, NAT timeout,
server-initiated close, network change). Once a clean disconnect
happened the menu bar speed indicator froze on the last received
values indefinitely.
Schedule the existing exponential-backoff retry on every disconnect,
log a 'clean' label when no error was supplied, and cap the backoff
at 64s so a long outage cannot push the next attempt hours away.
Also switch the socket identity check from == to === and ignore
disconnects from stale sockets (one whose reference was already
replaced inside requestTrafficInfo/requestLog during a reconnect
cycle) — previously the old traffic socket's delayed disconnect
callback fell into the else branch and scheduled a spurious
loggingWebSocket retry.1 parent e8586c7 commit a7ff626
1 file changed
Lines changed: 33 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
566 | 567 | | |
567 | 568 | | |
568 | 569 | | |
569 | | - | |
570 | | - | |
| 570 | + | |
| 571 | + | |
571 | 572 | | |
572 | 573 | | |
573 | | - | |
574 | | - | |
575 | 574 | | |
576 | 575 | | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
587 | 583 | | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
596 | 606 | | |
| 607 | + | |
597 | 608 | | |
598 | 609 | | |
599 | 610 | | |
| |||
0 commit comments