Skip to content

[ticket/17657] Improve invalid and stale push subscriptions (plus some fixes)#6961

Open
iMattPro wants to merge 8 commits into
phpbb:masterfrom
iMattPro:ticket/17657
Open

[ticket/17657] Improve invalid and stale push subscriptions (plus some fixes)#6961
iMattPro wants to merge 8 commits into
phpbb:masterfrom
iMattPro:ticket/17657

Conversation

@iMattPro
Copy link
Copy Markdown
Member

@iMattPro iMattPro commented May 20, 2026

PHPBB-17657

Checklist:

  • Correct branch: master for new features; 3.3.x for fixes
  • Tests pass
  • Code follows coding guidelines: master and 3.3.x
  • Commit follows commit message format

Tracker ticket:

https://tracker.phpbb.com/browse/PHPBB-17657

@iMattPro iMattPro changed the title [ticket/17657] Improve invalid and stale subscriptions (plus some fixes) [ticket/17657] Improve invalid and stale push subscriptions (plus some fixes) May 21, 2026
@marc1706 marc1706 requested a review from Copilot May 22, 2026 06:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread phpBB/phpbb/notification/method/webpush.php
Comment thread phpBB/phpbb/notification/method/webpush.php Outdated
Comment thread phpBB/phpbb/ucp/controller/webpush.php Outdated
Comment thread tests/notification/notification_method_webpush_test.php
Comment thread tests/notification/notification_method_webpush_test.php
Comment thread tests/notification/notification_method_webpush_test.php Outdated
Comment thread phpBB/assets/javascript/webpush.js
Comment thread phpBB/assets/javascript/webpush.js
Comment thread phpBB/assets/javascript/webpush.js
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.

2 participants