brackt/app/hooks/__tests__
Chris Parsons 43660d16e9
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 1m36s
🚀 Deploy / ʦ TypeScript (pull_request) Successful in 1m21s
🚀 Deploy / 🔍 Lint (pull_request) Successful in 50s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
Fix unhandled rejection from session ping when network is unavailable
The 15-minute keep-alive interval in useDraftAuthRecovery called
authClient.getSession() with no try-catch. When the network is
unavailable (e.g. computer waking from sleep), better-fetch throws a
TypeError rather than returning an in-band error, producing an
unhandled promise rejection that was surfacing in Sentry.

Adds a try-catch that silently swallows network TypeErrors — real
session expiry (401) is still caught by the existing !session check
because better-fetch returns HTTP errors in-band as { data: null }.

Adds tests covering the three ping outcomes: network throw, null
session (expired), and valid session.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 09:08:52 -07:00
..
useDraftAuthRecovery.session-ping.test.ts Fix unhandled rejection from session ping when network is unavailable 2026-05-27 09:08:52 -07:00
useDraftSocket.draft-state-sync.test.ts fix: guard against stale revalidation overwriting fresh socket data 2026-03-01 12:23:24 -08:00
useDraftSocket.reconnect.test.ts fix: fully sync local draft state after socket reconnection (#41) 2026-02-27 22:50:46 -08:00