Skip to content

Build Following structure #1839

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

Build Following structure #1839

merged 160 commits into from
Jul 2, 2025

Conversation

pfefferle
Copy link
Member

@pfefferle pfefferle commented Jun 20, 2025

This PR is the next step of the Followers/Following milestone. It wraps up the Followers v2 initiative and implements the Following v1 logic.

Proposed changes:

  • Actors CRUD: Create, read, update, and delete operations for remote Actor entities.
  • Follow collection support: Basic Accept handling when a follow request is accepted by the target actor.
  • follow() function: Helper to initiate a Follow request to a remote actor.
  • Outbox handling:
    • Follow activities are now added to the outbox.
    • Follow activity generation and delivery.
  • Status updates: Follower relationship status transitions from pending to accepted upon receiving an Accept.

Notes:

First step towards: #1036

Other information:

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

Testing instructions:

  • See tests.

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

Support for sending follow requests to remote actors is now in place, including outbox delivery and status updates—UI integration will follow later.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@pfefferle pfefferle requested review from obenland and Copilot June 26, 2025 12:25
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 introduces the initial implementation for the Following structure as part of the Followers v2 initiative, adding support for accepting follow requests, outbox delivery, and basic actors CRUD operations for remote actors. Key changes include:

  • New unit tests for Accept, Following, and Actors collections.
  • Implementation of new functions (e.g. follow()) and handlers (e.g. Accept) to process follow requests.
  • Updates to actor upsert, remote lookup, and related functionalities.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/includes/handler/class-test-accept.php Adds unit tests for the Accept handler.
tests/includes/collection/class-test-following.php Adds comprehensive tests for following requests handling.
tests/includes/collection/class-test-followers.php Removes an unnecessary line in faulty followers test.
tests/includes/collection/class-test-actors.php Adds tests for creating, updating, deleting, and looking up remote actors.
includes/handler/class-move.php Minor change: adds an empty line after upserting target actor data.
includes/handler/class-accept.php New Accept handler implementation with validation and processing logic.
includes/functions.php Introduces a new follow() helper function for initiating follow requests.
includes/collection/class-following.php Implements the Following collection with follow() and accept() methods.
includes/collection/class-actors.php Updates in actor CRUD operations and lookup logic including upsert, create, update methods.
includes/class-handler.php Registers the new Accept handler in the global handler registration.
.github/changelog/1839-from-description Changelog entry for the new follow/outbox support.

pfefferle and others added 2 commits June 26, 2025 14:28
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 feels really close, nice work!

@pfefferle
Copy link
Member Author

@obenland I changed the Accept handling, so maybe you need to have a second look at: 2b65e48

@obenland
Copy link
Member

I changed the Accept handling, so maybe you need to have a second look at: 2b65e48

Looking good! ✨

@obenland obenland 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.

Let's get it in!

@pfefferle pfefferle merged commit 5ed2bd9 into trunk Jul 2, 2025
11 checks passed
@pfefferle pfefferle deleted the add/following-structure branch July 2, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] CLI [Feature] Collections [Feature] REST API [Focus] Editor Changes to the ActivityPub experience in the block editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants