Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dupe check #386

Merged
merged 6 commits into from
Apr 30, 2023
Merged

Update dupe check #386

merged 6 commits into from
Apr 30, 2023

Conversation

dshanske
Copy link
Collaborator

This updates the dupe check parameters to search for dupes by matching on webmention_source_url, url, _crossposting_link or source_url in one query instead of multiple queries.

webmention_source url = the original source url
url = the canonical url in the event of something like a Bridgy post
_crossposting_link for Salmon
source_url for ActivityPub

@dshanske dshanske requested a review from pfefferle April 16, 2023 15:06
@dshanske
Copy link
Collaborator Author

Makes me wonder if we shouldn't migrate to source_url to match activitypub.

( isset( $commentdata['comment_type'] ) && 'webmention' === $commentdata['comment_type'] ) ||
( isset( $commentdata['comment_meta'] ) && ! empty( $commentdata['comment_meta']['semantic_linkbacks_type'] ) )
) {
if ( ! empty( $commentdata['comment_meta']['protocol'] ) && 'webmention' === $commentdata['comment_meta']['protocol'] ) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a check that is only supposed to be triggered on a Webmention, but no issue with an existence check

@dshanske dshanske added this to the 5.1.0 milestone Apr 18, 2023
@pfefferle
Copy link
Owner

@dshanske do we have to encode the URLs before checking? Maybe this solves the encoding issue?

/cc @snarfed

@dshanske
Copy link
Collaborator Author

I don't think we do. Don't we have to decode them?

@snarfed
Copy link
Contributor

snarfed commented Apr 18, 2023

for reference: #359 (comment)

@pfefferle
Copy link
Owner

@dshanske not decode, but encode! Because they are saved encoded didn't they? esc_url??

@dshanske
Copy link
Collaborator Author

This is how I confuse myself

@pfefferle
Copy link
Owner

😊

I think we should add some tests, to see what is correct!

@pfefferle
Copy link
Owner

I would love to use this, to add some tests. Maybe @snarfed has some "special" URLs for us ;)

@dshanske
Copy link
Collaborator Author

@pfefferle Do you want to merge this and do the urlencode testing as a separate PR?

Copy link
Owner

@pfefferle pfefferle left a comment

Choose a reason for hiding this comment

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

LGTM

@dshanske dshanske merged commit 349cefe into main Apr 30, 2023
@dshanske dshanske deleted the dupes branch April 30, 2023 21:28
This was referenced Apr 30, 2023
@dshanske dshanske mentioned this pull request Jun 3, 2023
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.

3 participants