Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TypeError in NotificationsList Component #8007

Closed
wants to merge 1 commit into from

Conversation

bodhish
Copy link
Member

@bodhish bodhish commented Jun 9, 2024

Related to #8006

Implements error handling and service worker checks in the NotificationsList component to prevent TypeError on unsupported browsers.

  • Service Worker and Push Manager Checks: Adds a check for the availability of navigator.serviceWorker and reg.pushManager before attempting to subscribe or unsubscribe to push notifications. This prevents errors in browsers where these features are not supported.
  • Error Handling: Implements a try-catch block around the subscription status check logic within intialSubscriptionState function. This captures any errors that occur during the check, preventing the application from crashing and logs the error using Sentry.
  • Subscription Status: Modifies the logic to set the subscription status to "Error" in case of any exceptions during the initial subscription state check, ensuring the UI can react appropriately to the error state.

For more details, open the Copilot Workspace session.

@bodhish bodhish requested a review from a team as a code owner June 9, 2024 18:05
Copy link

vercel bot commented Jun 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 9, 2024 6:06pm

Copy link

netlify bot commented Jun 9, 2024

Deploy Preview for care-egov-staging failed.

Name Link
🔨 Latest commit b0413e3
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/6665eee63191c70008901992

@bodhish
Copy link
Member Author

bodhish commented Jun 9, 2024

@gigincg can you review my PR? :D

@github-actions github-actions bot added the Deploy-Failed Deplyment is not showing preview label Jun 9, 2024
Copy link

netlify bot commented Jun 9, 2024

Deploy Preview for care-net failed.

Name Link
🔨 Latest commit b0413e3
🔍 Latest deploy log https://app.netlify.com/sites/care-net/deploys/6665eee6efdb410008edd368

@bodhish bodhish requested a review from rithviknishad June 11, 2024 02:52
@bodhish bodhish deleted the bodhish/fix-notification-subscription branch December 1, 2024 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deploy-Failed Deplyment is not showing preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants