[ticket/17657] Improve invalid and stale push subscriptions (plus some fixes)#6961
Open
iMattPro wants to merge 8 commits into
Open
[ticket/17657] Improve invalid and stale push subscriptions (plus some fixes)#6961iMattPro wants to merge 8 commits into
iMattPro wants to merge 8 commits into
Conversation
PHPBB-17657
There was a problem hiding this comment.
Pull request overview
This PR improves phpBB’s Web Push subscription handling by making subscriptions more resilient to stale/invalid endpoints and by tightening backend/frontend coordination for subscription refresh flows, while adding regression tests for these cases.
Changes:
- Update UCP subscribe/unsubscribe handling to normalize payloads (including expirationTime) and support replacing prior endpoints.
- Improve Web Push delivery cleanup logic (expired/unauthorized/permanently-removed endpoints) and fix per-user push token mapping.
- Expand unit/functional test fixtures and add targeted tests for subscription replacement, cleanup, and token correctness.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/ucp/fixtures/webpush.xml | Adds push subscriptions table to the UCP webpush test fixture. |
| tests/ucp/controller_webpush_test.php | Refactors request creation and adds tests for replacing/preserving subscriptions. |
| tests/notification/notification_method_webpush_test.php | Adds tests for expired/dead endpoints cleanup, per-user token mapping, and expirationTime units. |
| tests/notification/fixtures/webpush_notification.type.post.xml | Extends push subscriptions fixture columns needed for payload encryption. |
| phpBB/phpbb/ucp/controller/webpush.php | Reads subscription payload from POST body, validates/normalizes fields, and replaces previous endpoints safely. |
| phpBB/phpbb/notification/method/webpush.php | Fixes push token map keying, adds additional cleanup conditions, and adjusts UCP template data expirationTime units. |
| phpBB/assets/javascript/webpush.js | Introduces refresh/persist flows, VAPID-key mismatch detection, and improves subscription state handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PHPBB-17657
PHPBB-17657
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.
PHPBB-17657
Checklist:
Tracker ticket:
https://tracker.phpbb.com/browse/PHPBB-17657