Skip to content

Handle Follow rejects #1865

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

Merged
merged 160 commits into from
Jul 2, 2025
Merged

Handle Follow rejects #1865

merged 160 commits into from
Jul 2, 2025

Conversation

pfefferle
Copy link
Member

@pfefferle pfefferle commented Jun 27, 2025

Implement basic Reject handling.

The focus of this PR is on rejecting Follow requests, but we will add support for other Rejects in the future: https://www.w3.org/wiki/ActivityPub/Primer/Reject_activity#Additional_uses_of_Reject

Proposed changes:

  • Handle Follow rejects

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Follow an Account that supports Accepting and Rejecting Follow requests
  • Reject Follow request

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Added basic support for handling remote rejections of follow requests.

@Copilot Copilot AI review requested due to automatic review settings June 27, 2025 08:01
Copilot

This comment was marked as outdated.

@pfefferle pfefferle changed the title Reject handling Handle Follow rejects Jun 27, 2025
@pfefferle pfefferle changed the base branch from trunk to add/following-structure June 27, 2025 08:02
@pfefferle pfefferle self-assigned this Jun 27, 2025
@pfefferle pfefferle requested a review from obenland June 27, 2025 08:02
@pfefferle pfefferle mentioned this pull request Jun 27, 2025
11 tasks
Copy link
Member

@obenland obenland left a comment

Choose a reason for hiding this comment

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

This looks really good. I think it'd be optimal to wait with merging until #1839 is in, to avoid making that PR even bigger.

obenland
obenland previously approved these changes Jun 30, 2025
Base automatically changed from add/following-structure to trunk July 2, 2025 13:30
@pfefferle pfefferle dismissed obenland’s stale review July 2, 2025 13:30

The base branch was changed.

@pfefferle pfefferle requested review from Copilot and obenland July 2, 2025 13:33
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds basic support for handling remote Reject activities for follow requests in ActivityPub.

  • Introduce a Reject handler to process rejected follow activities and send notifications
  • Extend the Following collection with a reject method to clean up pending/following metadata
  • Register the new handler hook and include unit tests and a changelog entry

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/includes/handler/class-test-reject.php Add unit tests covering validation and functional reject flow
includes/handler/class-reject.php Implement Reject handler with follow-reject logic
includes/collection/class-following.php Add reject method to remove pending/following metadata
includes/class-handler.php Register the Reject handler in the main dispatcher
.github/changelog/1865-from-description Add changelog entry for this feature
Comments suppressed due to low confidence (2)

tests/includes/handler/class-test-reject.php:112

  • [nitpick] The test method name implies the user remains in pending after a reject, but the assertions verify removal from pending. Consider renaming to test_handle_reject_removes_user_from_pending for clarity.
	public function test_handle_reject_keeps_user_in_pending() {

tests/includes/handler/class-test-reject.php:164

  • The inline comment conflicts with the following assertNotContains check. Update the comment to say Assert: user_id is NOT in _activitypub_followed_by_pending to match the assertion.
		// Assert: user_id is STILL in _activitypub_followed_by_pending.

@pfefferle pfefferle merged commit caf3c06 into trunk Jul 2, 2025
11 checks passed
@pfefferle pfefferle deleted the add/reject-handling branch July 2, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants