Skip to content

Rework Follower Structure #1759

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

Open
wants to merge 75 commits into
base: trunk
Choose a base branch
from
Open

Rework Follower Structure #1759

wants to merge 75 commits into from

Conversation

pfefferle
Copy link
Member

@pfefferle pfefferle commented Jun 3, 2025

Rework follower structure to enable reuse of the pattern for the following mechanism.

This is the first major change to the follower structure, enabling the unified storage of "Remote Actors" — such as followers, followings, and mentioned actors. The first step is to migrate all generic functionality to the Actors collection and use the Followers collection solely to map an actor to a local user.

The next steps will be (further PRs):

  • Deprecate the Follower model in favor of the generic Actor model
  • Establish class structure for Followings
  • Add an internal API for managing Followings

Proposed changes:

  • Move Actor handling to the Actors collection to enable a unified structure for followers and followings
  • Avoid transforming post-type objects into Actor objects for internal operations to reduce resource usage and simplify handling
  • Update tests

Other information:

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

Testing instructions:

  • No user facing changes
  • 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

Reworked follower structure to simplify handling and enable reuse for following mechanism.

@pfefferle pfefferle marked this pull request as ready for review June 4, 2025 16:22
@pfefferle pfefferle requested a review from Copilot June 4, 2025 16:23
Copilot

This comment was marked as outdated.

@pfefferle pfefferle requested review from obenland and Copilot June 5, 2025 08:02
Copilot

This comment was marked as outdated.

@pfefferle pfefferle requested a review from Copilot June 5, 2025 13:08
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

Reworks the follower structure to rely on a unified Actor model rather than a distinct Follower model, simplifying internal handling and enabling reuse for extending functionality (e.g., followings).

  • Migrates functionality from Followers to Actors and refactors tests accordingly.
  • Updates and deprecates legacy methods to streamline actor/remote object management.
  • Adjusts utility functions and scheduler methods to support the new data model.

Reviewed Changes

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

Show a summary per file
File Description
tests/includes/model/class-test-follower.php Updates tests to use Actors instead of Followers and simplifies error handling.
tests/includes/handler/class-test-update.php Refactors actor update tests to expect Actor objects and new retrieval methods.
tests/includes/handler/class-test-move.php Replaces legacy Follower functions with Actors ones for moving actors between profiles.
includes/model/class-follower.php Updates Follower methods to delegate saving and error management to the Actors class.
includes/collection/class-followers.php Deprecates certain methods in favor of their Actor counterparts and adjusts meta usage.
includes/collection/class-actors.php Introduces new methods for adding, updating, and retrieving remote Actor objects.
includes/class-scheduler.php Renames and updates scheduler methods to work with imported actors rather than followers.
others (functions, migration, blocks, etc.) Minor updates to remove Followers references and ensure consistency with the new Actor model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Collections [Focus] Compatibility Ensuring the plugin plays well with other plugins [Status] In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants