Send profile updates when the Starter Kit policy changes#3405
Merged
Conversation
The policy is part of every actor profile (FEP-7aa9 canFeature), so a change must be federated for the blog actor and all author actors.
There was a problem hiding this comment.
Pull request overview
This PR ensures that changing the site-wide “Default Starter Kit policy” (stored in activitypub_default_feature_policy) federates an Update for all relevant local actors so remote servers don’t keep evaluating requests against a stale profile policy.
Changes:
- Hook option add/update for
activitypub_default_feature_policyto schedule profile updates for the blog actor and all ActivityPub-capable users (skipping disabled actor types). - Add PHPUnit coverage validating the fan-out behavior and the “blog-only” mode skip.
- Add a changelogger entry documenting the fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
includes/scheduler/class-actor.php |
Adds option hooks and introduces schedule_all_profile_updates() to fan out profile Update activities when the Starter Kit policy changes. |
tests/phpunit/tests/includes/scheduler/class-test-actor.php |
Adds tests asserting outbox Update scheduling for all actors and respecting disabled user actors. |
.github/changelog/update-starter-kit-policy-profile-updates |
Documents the behavior change as a patch fix. |
Comment on lines
+52
to
+55
| // The Starter Kit policy is part of every actor profile. | ||
| \add_action( 'add_option_activitypub_default_feature_policy', array( self::class, 'schedule_all_profile_updates' ) ); | ||
| \add_action( 'update_option_activitypub_default_feature_policy', array( self::class, 'schedule_all_profile_updates' ) ); | ||
|
|
Member
Author
There was a problem hiding this comment.
PHP does not warn when a userland function receives more arguments than declared — extra args are simply ignored (a TypeError only applies to internal functions). This is also the established pattern in this file: blog_user_update() and the other option hooks rely on the same behavior. Leaving as is.
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:
Other information:
Testing instructions: