fix(realtime): refresh tokens in background and clear on disconnect (#201)
The active state had no handler for token expiry, so tokens were never refreshed. Replace the broken expireToken approach with a recurring background fetch that updates the token in-place via a new authenticated transition, keeping the WebSocket open. Use a generation counter to prevent stale callbacks from spawning parallel refresh loops. Also expire the token on connectionClosed and close so reconnects always re-authenticate instead of reusing a stale token.
N
noah committed
5a97ffa4d4c769501f2bec5f504c6d117d52ad39
Parent: b802926
Committed by GitHub <noreply@github.com>
on 2/27/2026, 1:00:31 AM