Fix: Unhandled push notification error on unsupported browsers#867
Closed
sentry[bot] wants to merge 1 commit into
Closed
Fix: Unhandled push notification error on unsupported browsers#867sentry[bot] wants to merge 1 commit into
sentry[bot] wants to merge 1 commit into
Conversation
Contributor
|
Contributor
Deploying with
|
| Status | Preview URL | Commit | Alias | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! | https://pr-867-sable.raspy-dream-bb1d.workers.dev | 240e9e2 | pr-867 |
Tue, 19 May 2026 10:17:49 GMT |
Member
|
bad bot (i think i disabled this on the sentry site so it shouldn’t be making prs anymore) |
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.
Description
This PR addresses the issue SABLE-MB, where an unhandled error "Push messaging is not supported in this browser." was thrown repeatedly on browsers lacking Push API support (e.g., DuckDuckGo, certain mobile browsers).
The fix implements the following changes:
enablePushNotifications: TheenablePushNotificationsfunction inPushNotifications.tsxnow returns gracefully instead of throwing an error whenserviceWorkerorPushManageris unavailable. This prevents unhandled exceptions and improves application stability on unsupported platforms.togglePusher: ThetogglePusherfunction now includes anisPushSupported()check at its entry point. This prevents any attempts to enable or disable push notifications if the browser does not support the necessary APIs, stopping the error from occurring on visibility changes.WebPushNotificationSettingcomponent inSystemNotification.tsxnow checksisPushSupported()and returnsnullif push notifications are not supported. This hides the push notification settings UI from users on incompatible browsers, preventing them from enabling a non-functional feature.isPushSupportedHelper: A new exported helper functionisPushSupportedwas added toPushNotifications.tsxto centralize the browser capability check.Fixes #SABLE-MB
Type of change
Checklist:
AI disclosure:
Fixes SABLE-MB