Clean up permanently removed endpoints#127
Open
iMattPro wants to merge 1 commit intophpbb-extensions:mainfrom
Open
Clean up permanently removed endpoints#127iMattPro wants to merge 1 commit intophpbb-extensions:mainfrom
iMattPro wants to merge 1 commit intophpbb-extensions:mainfrom
Conversation
a40c1d3 to
049e7fb
Compare
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.
Solution to https://www.phpbb.com/customise/db/extension/webpushnotifications/support/topic/253969?p=908491
The endpoint
permanently-removed.invalidis a known placeholder that the web-push-php library (Minishlink) substitutes when a PushSubscription object is unsubscribed in the browser before the stored endpoint in the database is cleaned up server-side. When phpBB tries to deliver to it, cURL fails with error 6 (DNS resolution failure) because.invalidis an RFC 6761-reserved TLD that never resolves. The Minishlink library wraps this as a MessageSentReport with a null response. Our existing checks for expired or unauthorized subscriptions return false when the response is null — so the else branch fires, logging this as noise and crucially never cleaning up the dead subscription.This PR will now check for
permanently-removed.invalidand clean those up without logging them as an error, so only true errors get logged.