Skip to content

fix(hooks): add error handler to useSSE#52

Open
Tmalone1250 wants to merge 1 commit into
entrius:testfrom
Tmalone1250:fix/44
Open

fix(hooks): add error handler to useSSE#52
Tmalone1250 wants to merge 1 commit into
entrius:testfrom
Tmalone1250:fix/44

Conversation

@Tmalone1250
Copy link
Copy Markdown

@Tmalone1250 Tmalone1250 commented Apr 27, 2026

Closes Issue #44

Summary

  • Added an error event listener to the EventSource instance in the useSSE hook (src/hooks/useSSE.ts).
  • Logs SSE connection errors to the console (console.error) to prevent silent failures and aid in debugging.

Why

SSE connection failures were previously unhandled, making it difficult for developers to diagnose connectivity issues and leaving users unaware of why live updates might have stopped. This fix ensures that errors are at least surfaced in the console.

Test plan

  • Verified via reproduce_issue_44.test.tsx that the error listener is correctly registered during hook initialization.
  • Build check: npm run build (including tsc -b) - SUCCESS.
  • Manual check: Simulated network disconnection in the browser and confirmed the SSE connection error message appears in the console.

Attachments

pre_fix_failure.log
post_fix_success.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] useSSE hook has no onerror handler — SSE connection failures are invisible to users

1 participant