Summary
Unhandled promise rejections (e.g. from fire-and-forget async calls outside React) are silently swallowed in production. A window.onunhandledrejection handler should capture these and emit a structured log before they disappear.
Scope
- Register a
window.onunhandledrejection handler on app initialisation alongside the existing window.onerror handler
- Emit a debug-level structured log on each unhandled rejection with fields:
reason, promise_origin, rejected_at
- Handler should not suppress the default browser behaviour
- Handler registered once on init, not on re-renders
- Log not emitted in the test environment
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
Unhandled promise rejections (e.g. from fire-and-forget async calls outside React) are silently swallowed in production. A
window.onunhandledrejectionhandler should capture these and emit a structured log before they disappear.Scope
window.onunhandledrejectionhandler on app initialisation alongside the existingwindow.onerrorhandlerreason,promise_origin,rejected_atAcceptance Criteria
ETA: 12 hours
Coordinate on Telegram