Surface web push subscription failures in the client output - #127
Open
ctoth wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ensurePushSubscriptionpreviously only hitconsole.error, leaving users with no visible sign that push notifications weren't enabled.App.tsxnow also routes the failure into the output store (useOutputStore.addError), so it appears in the client output like other errors.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_lifecyclenow saves/restoressubscriptions(it used to wipe real registrations).$web_push_registry:send_notificationnow unregisters a subscription when FCM returns 404/410.Testing
tsc --noEmitclean;vitest run src/App.test.tsx src/webpush.test.tspasses (5/5)./api/webpush/public_key→ subscribe → registration POST → MOOsend_notification→ FCM 201 → service worker displayed the notification.🤖 Generated with Claude Code
https://claude.ai/code/session_01WvzVpAsrRox5Vnj1rogaxG