brackt/app/hooks
Chris Parsons 64a60a75d8
fix: eliminate socket ghost connection and stale state on reconnect (#38)
- Reduce ping detection window from ~45s to ~15s (pingTimeout 5s, pingInterval 10s)
- Listen to window offline/online events for instant UI feedback on network drop
- Force immediate reconnect on online event instead of waiting for backoff
- Fix stuck-reconnecting bug when network returns within ping timeout window
- Wrap on/off/emit in useCallback to prevent listener re-registration every second
- Expose reconnectCount to trigger revalidator.revalidate() after each reconnect
- Reset hasConnectedOnce ref per socket instance to avoid spurious revalidations
- Remove stale socket ref from hook return value; add emit helper instead

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 12:24:04 -08:00
..
useDraftNotifications.ts Add browser push notifications toggle to draft page (#11) 2026-02-20 19:30:53 -08:00
useDraftSocket.ts fix: eliminate socket ghost connection and stale state on reconnect (#38) 2026-02-24 12:24:04 -08:00
useMediaQuery.ts Make draft room fully usable on mobile (#30) 2026-02-22 22:36:12 -08:00