Skip to content

Conversation

@rosa
Copy link
Member

@rosa rosa commented Jan 23, 2026

This PR includes a few fixes related to web push notifications:

  • Fix stuck state when permission granted but no subscription.
    When you had already granted notification permission but hadn't completed the subscription flow (no service worker or no push subscription), the UI showed neither the subscribe button nor the enabled state, leaving you stuck with no way to subscribe, and wrong instructions to fix it.
Screenshot From 2026-01-23 13-25-12 Instead, let's just show the button to allow you to subscribe.
  • Wait for service worker to be active before subscribing
    The push subscription requires an active service worker. When registering a new service worker, we now wait for it to become active using navigator.serviceWorker.ready before attempting to subscribe to push notifications. This prevents the following error:
notifications_controller-5999c5a4.js:66 Uncaught (in promise) AbortError: Failed to execute 'subscribe' on 'PushManager': Subscription failed - no active Service Worker
    at #subscribe (notifications_contro…er-5999c5a4.js:66:8)
    at t.attemptToSubscribe (notifications_contro…r-5999c5a4.js:37:42)
#subscribe	@

and the button not working.

  • Fix notification click URL by using the correct data property
    The web push payload sends the URL in data.url, but the service worker was looking for data.path, resulting in `/undefined' URLs and 404 errors. Reverted: see comment.

rosa and others added 3 commits January 23, 2026 14:23
When you had already granted notification permission but hadn't
completed the subscription flow (no service worker or no push
subscription), the UI showed neither the subscribe button nor the
enabled state, leaving you stuck with no way to subscribe, and wrong
instructions to fix it.

Instead, let's just show the button to allow you to subscribe.
The push subscription requires an active service worker. When
registering a new service worker, we now wait for it to become
active using navigator.serviceWorker.ready before attempting
to subscribe to push notifications.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The web push payload sends the URL in data.url but the service
worker was looking for data.path, resulting in undefined URLs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Collaborator

@kevinmcconnell kevinmcconnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one, @rosa!

@rosa rosa merged commit 4f2308d into main Jan 23, 2026
12 checks passed
@rosa rosa deleted the web-push-fixes branch January 23, 2026 15:38
@rosa
Copy link
Member Author

rosa commented Jan 23, 2026

Update: I reverted e731725, this was a mistake! It was broken in my local branch but I hadn't realised 😅 It was correct.

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.

3 participants