Skip to content

Fix: Unhandled push notification error on unsupported browsers#867

Closed
sentry[bot] wants to merge 1 commit into
devfrom
seer/fix/sable-mb-push-error
Closed

Fix: Unhandled push notification error on unsupported browsers#867
sentry[bot] wants to merge 1 commit into
devfrom
seer/fix/sable-mb-push-error

Conversation

@sentry
Copy link
Copy Markdown

@sentry sentry Bot commented May 19, 2026

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:

  1. Graceful enablePushNotifications: The enablePushNotifications function in PushNotifications.tsx now returns gracefully instead of throwing an error when serviceWorker or PushManager is unavailable. This prevents unhandled exceptions and improves application stability on unsupported platforms.
  2. Capability Guard in togglePusher: The togglePusher function now includes an isPushSupported() 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.
  3. Conditional UI Rendering: The WebPushNotificationSetting component in SystemNotification.tsx now checks isPushSupported() and returns null if 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.
  4. isPushSupported Helper: A new exported helper function isPushSupported was added to PushNotifications.tsx to centralize the browser capability check.

Fixes #SABLE-MB

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

AI disclosure:

  • Partially AI assisted (clarify which code was AI assisted and briefly explain what it does).
  • Fully AI generated (explain what all the generated code does in moderate detail).

Fixes SABLE-MB

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Missing changeset

This pull request does not include a changeset. Please add one before requesting review so the change is properly documented and included in the release notes.

How to add a changeset:

  1. Run pnpm run document-change (interactive) and commit the generated file, or
  2. Manually create .changeset/<descriptive-name>.md:
---
default: patch
---

Short user-facing summary of the change.

Replace patch with major, minor, patch, docs, or note as appropriate.

📖 Read more in CONTRIBUTING.md.

If this PR is internal/maintenance with no user-facing impact, a maintainer can add the internal label to skip this check.

@github-actions
Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

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

@7w1
Copy link
Copy Markdown
Member

7w1 commented May 20, 2026

bad bot (i think i disabled this on the sentry site so it shouldn’t be making prs anymore)

@7w1 7w1 closed this May 20, 2026
@7w1 7w1 deleted the seer/fix/sable-mb-push-error branch May 20, 2026 06:39
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