-
Notifications
You must be signed in to change notification settings - Fork 81
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
Conversation
This reverts commit e3e53b0.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few undefined method and properties calls that would benefit from another iteration before this gets merged
…/wordpress-activitypub into remove/follower-model
…/wordpress-activitypub into remove/follower-model
There was a problem hiding this 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 overhauls the follower subsystem by consolidating all remote-actor storage and operations into a single Actors custom post type.
Key changes:
- Redirect all follower CRUD and error-tracking APIs to the new Actors collection and deprecate the standalone Follower model.
- Update Follow, Update, Move, Delete handlers to upsert and query via Actors methods instead of Follower.
- Adjust scheduler hooks and all tests to work with Actors (WP_Post) rather than the old Follower model.
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
includes/model/class-follower.php | Refactored delete and error methods to delegate to Actors. |
includes/collection/class-followers.php | Updated metadata APIs; remove_follower now uses post meta. |
includes/handler/class-follow.php | Use WP_Post ($remote_actor) instead of Follower; changed queue_accept actor. |
includes/handler/class-move.php | Handle Move via Actors CPT (get_remote_by_uri, upsert). |
includes/class-scheduler.php | Renamed cron hooks for remote actor updates and cleanup. |
Comments suppressed due to low confidence (1)
includes/handler/class-follow.php:114
- In
queue_accept
, setting the activity actor to the follower'sguid
is incorrect. The Accept must be sent by the local user, so you should useActors::get_by_id($user_id)->get_id()
instead.
$activity->set_actor( $remote_actor->guid );
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge and iterate if needed. Nice work!
* | ||
* @return string Hopefully the name of the Follower. | ||
*/ | ||
function extract_name_from_uri( $uri ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I worry that moving it here will make it harder to refactor and remove.
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):
Proposed changes:
Other information:
Testing instructions:
Changelog entry
Changelog Entry Details
Significance
Type
Message
Reworked follower structure to simplify handling and enable reuse for following mechanism.