Strengthen error catching and reporting#119
Merged
iMattPro merged 8 commits intophpbb-extensions:mainfrom Dec 22, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances error handling for push notification subscriptions by wrapping the subscription logic in try/catch blocks and adding console error logging and user alerts for edge cases where subscription might fail, such as in Opera One browser.
Key Changes:
- Added try/catch block around the subscription flow in
subscribeButtonHandlerto catch and report errors - Updated the popup allow button handler to catch errors from subscription attempts
- Added
data-disabled-msgattribute to the subscribe button for fallback error messages
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| styles/all/template/webpush.js | Added try/catch error handling to subscription logic with console logging and user alerts; updated popup allow button handler to catch subscription errors |
| styles/all/template/event/notification_dropdown_footer_after.html | Added data-disabled-msg attribute to subscribe button for fallback error messaging |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
in current implementation, every time the user clicks subscribe, a new listener gets added on top of the existing ones, causing multiple handlers to execute and an infinite loop of event listener additions.
rxu
approved these changes
Dec 22, 2025
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.
Put subscription/registration into a try/catch to catch edge cases where subscribing might still fail, and add console error logging and a user alert message for those cases.
For example, Opera One at this moment is not able to subscribe to any push notifications. Yet it's failure was going un-noticed. With this we can catch the error and notify the user.