Skip to content

Surface web push subscription failures in the client output - #127

Open
ctoth wants to merge 1 commit into
masterfrom
fix/webpush-surface-subscribe-errors
Open

Surface web push subscription failures in the client output#127
ctoth wants to merge 1 commit into
masterfrom
fix/webpush-surface-subscribe-errors

Conversation

@ctoth

@ctoth ctoth commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • A failed ensurePushSubscription previously only hit console.error, leaving users with no visible sign that push notifications weren't enabled.
  • The catch in App.tsx now also routes the failure into the output store (useOutputStore.addError), so it appears in the client output like other errors.
  • Chrome reports a wedged GCM connection as AbortError: Registration failed - push service error; for that case the message appends a hint that restarting the browser usually fixes it (diagnosed while verifying webpush end to end — server, FCM, and service worker legs all confirmed working).

Related server-side work (live in the MOO, not in this repo)

  • $web_push_registry:test_subscription_lifecycle now saves/restores subscriptions (it used to wipe real registrations).
  • $web_push_registry:send_notification now unregisters a subscription when FCM returns 404/410.

Testing

  • tsc --noEmit clean; vitest run src/App.test.tsx src/webpush.test.ts passes (5/5).
  • Full e2e verified live: GMCP token → /api/webpush/public_key → subscribe → registration POST → MOO send_notification → FCM 201 → service worker displayed the notification.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WvzVpAsrRox5Vnj1rogaxG

Previously a failed ensurePushSubscription only logged to the console, so
users had no visible hint that push notifications were not enabled. Route
the error into the output store, and add a restart-browser hint for
Chrome's "push service error" (wedged GCM connection), which we diagnosed
while getting webpush working end to end.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WvzVpAsrRox5Vnj1rogaxG
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.

1 participant