Commit e47ee94
committed
fix(ui): debounce sessions.list reload after sessions.changed push events
The dashboard subscribes to sessions.changed push events for real-time
UI updates. However, every push event also triggered an immediate full
sessions.list reload, causing excessive polling under load.
With 97 WebSocket connections, a single session change would fan out
to 97 simultaneous sessions.list calls. This creates unnecessary GC
pressure on the gateway and contributes to memory growth.
This change debounces the sessions.list reload to 5 seconds after the
last sessions.changed event. The incremental update from
applySessionsChangedEvent keeps the UI responsive immediately; the
debounced full reload reconciles any edge cases (e.g., sessions that
appeared/disappeared outside the push event's scope).
Impact:
- Reduces sessions.list calls by ~80-95% under normal load
- No change to real-time UI responsiveness (incremental updates unchanged)
- No server-side changes required
- 5s debounce is conservative; could be tuned or made configurable later1 parent 3ae6949 commit e47ee94
2 files changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
732 | 733 | | |
733 | 734 | | |
734 | 735 | | |
735 | | - | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
736 | 746 | | |
737 | 747 | | |
738 | 748 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
| 565 | + | |
565 | 566 | | |
566 | 567 | | |
567 | 568 | | |
| |||
0 commit comments