Fix Accept recipients for wrapped follows#3526
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes shared-inbox recipient resolution for Accept/Reject activities that wrap a Follow, ensuring the local recipient can be derived from the embedded Follow’s actor even when top-level addressing fields are missing.
Changes:
- Extend
Inbox_Controller::get_local_recipients()to include the embedded Follow actor as a candidate local recipient forAccept/Reject. - Add a PHPUnit regression test covering an
Acceptthat wraps aFollow(Flipboard-like shape). - Add a patch-level changelog entry for the fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| includes/rest/class-inbox-controller.php | Adds embedded-object actor as a recipient for Accept/Reject activities. |
| tests/phpunit/tests/includes/rest/class-test-inbox-controller.php | Adds regression coverage for resolving local recipients from an embedded Follow actor. |
| .github/changelog/3526-from-description | Documents the user-facing bugfix in the changelog. |
Move the embedded-Follow-actor recipient resolution out of the inbox controller and into extract_recipients_from_activity, where all activity recipient extraction lives, so an Accept/Reject that carries no top-level addressing is still delivered to the local Follow actor. Add direct coverage for the new behavior and give the recipient and mailer fixtures an explicit activity type. Claude-Session: https://claude.ai/code/session_01HDA9QR3bJoqM7NhnhT1whg
pfefferle
previously approved these changes
Jul 8, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot's auto-fix corrected two of the mocked-actor fixtures from the Activity type Create to the actor type Person; apply the same to the three it missed so the actor mocks are accurate. Claude-Session: https://claude.ai/code/session_01HDA9QR3bJoqM7NhnhT1whg
Add type checks in `extract_recipients_from_activity()` so Accept/Reject activities only read `object['actor']` when `object` is present and an array. This prevents invalid array access when the embedded object is missing or represented as a scalar.
pfefferle
approved these changes
Jul 9, 2026
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.
Proposed changes:
Acceptwraps the originalFollowand omits top-levelto/ccaddressing. See this Mastodon conversation.AcceptorRejectand the embedded object is aFollow.Other information:
Testing instructions:
https://alex.kirk.at/author/alex/tohttps://flipboard.com/users/BBCNews.Acceptlike:actor:https://flipboard.com/users/BBCNewsto,cc, oraudienceobject.type:Followobject.actor:https://alex.kirk.at/author/alex/object.object:https://flipboard.com/users/BBCNewshttps://flipboard.com/users/BBCNews, so the shared inbox resolved zero local recipients and the follow stayed pending.npm run env-test -- --filter=test_get_local_recipients_accept_follow_uses_object_actor.Changelog entry
Changelog Entry Details
Significance
Type
Message
Fix follow requests from some fediverse services staying pending after they are accepted.