Improve Webmention endpoint response messages#611
Merged
Conversation
When check_dupes() matches an existing comment, the endpoint updated the Webmention but still responded with 'Webmention was successful', which confused users who had already sent one natively and then tried the form again. Return a distinct, filterable message for the update case. Fixes #176
When check_dupes() matches an existing comment, the endpoint updated the Webmention but still responded with 'Webmention was successful', which confused users who had already sent one natively and then tried the form again. Return a distinct, filterable message for the update case and use a friendlier default for the success message. Fixes #176
…mention-message # Conflicts: # readme.md
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.
Summary
Fixes #176
When a Webmention is received for a source/target combination that already exists,
check_dupes()matches the existing comment and the endpoint updates it — but it still responded with "Webmention was successful". Users who had already sent a Webmention natively and then tried the form on the target page found this confusing.Changes
webmention_update_messagehook.target-updatepath; still filterable viawebmention_success_message).Note on the trim() warning quoted in the issue
The
trim() expects parameter 1 to be string, array givenwarning in the issue's quoted output comes from the deprecated semantic-linkbacks plugin, not from this codebase. An audit of this plugin's equivalent paths (mf2 handler, response/header parsing, sanitization) found the same failure class is already guarded against, so there is nothing to fix here.