You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix replies from the Fediverse to local WordPress comments, federated as ?c=NNN URLs, so they arrive as threaded comments on the cached Friends post.
Prevent local comment URLs from being misresolved by url_to_postid() before ActivityPub can fall back to url_to_commentid().
Let ActivityPub persist inbound interaction comments on ActivityPub-capable friend_post_cache posts only while handling the inbound Create activity, while keeping cached posts disabled for the normal ActivityPub post lifecycle.
Defer Friends feed-item creation for replies to local comments so ActivityPub's comment handler can process them.
Fix comment reply links on friend_post_cache posts to use the local Friends URL instead of the external source URL.
Extend remote comment fetching to ActivityPub-capable cached posts and dedupe comments that are already stored locally.
Add regression tests for the comment URL handling, ActivityPub comment persistence, Friends deferral, reply-link URL, and remote-comment deduplication.
Test plan
composer test -- --filter ActivityPubTest
composer check-cs
Comment on a friend's post that originates from an ActivityPub-capable source.
Have someone reply to that comment from the Fediverse.
Verify the reply arrives as a threaded comment on the correct Friends post, not as a standalone cached post.
Verify the "Reply" link on comments uses the local Friends URL, not the external source URL.
Verify remote comments load without duplicating locally stored comments.
Thus, it doesn't return something falsy and thus doesn't go into the fallback. Is this is an oversight? My fix in this PR is to make sure url_to_postid() returns something false by making the URL invalid. But I think it could be solved more elegantly in the ActivityPub plugin.
My case in the friends plugin might be even a bit more complicated because I am replying in the Friends backend to a not-ActivityPub enabled post (it was federated in but it's a friend_post_cache) but I think it's a valid case for overriding activitypub_is_post_disabled, so that makes it work!
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
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
?c=NNNURLs, so they arrive as threaded comments on the cached Friends post.url_to_postid()before ActivityPub can fall back tourl_to_commentid().friend_post_cacheposts only while handling the inbound Create activity, while keeping cached posts disabled for the normal ActivityPub post lifecycle.friend_post_cacheposts to use the local Friends URL instead of the external source URL.Test plan
composer test -- --filter ActivityPubTestcomposer check-csTest in WordPress Playground
Changelog
Type
Message
Fix ActivityPub replies to local comments not arriving as threaded comments