Skip to content

Send profile updates when the Starter Kit policy changes#3405

Merged
pfefferle merged 3 commits into
trunkfrom
update/starter-kit-policy-profile-updates
Jun 12, 2026
Merged

Send profile updates when the Starter Kit policy changes#3405
pfefferle merged 3 commits into
trunkfrom
update/starter-kit-policy-profile-updates

Conversation

@pfefferle

Copy link
Copy Markdown
Member

Proposed changes:

  • The Default Starter Kit policy setting (activitypub_default_feature_policy) is part of every actor profile as the FEP-7aa9 canFeature interaction policy, but changing it never federated an update — remote servers kept evaluating Starter Kit requests against the stale policy until an unrelated profile edit happened to trigger one.
  • Changing (or first saving) the setting now schedules an Update activity for the blog actor and for every user with the activitypub capability, honoring the actor mode: disabled actor types are skipped.
  • Reuses the existing profile-update scheduling in the Actor scheduler; the fan-out only runs on an admin settings save, and the capability query matches the established pattern used elsewhere.

Other information:

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

Testing instructions:

  • Enable both the blog actor and author profiles (Settings → ActivityPub → Profiles).
  • Follow the blog actor and an author from a Mastodon account.
  • Change Settings → ActivityPub → Activities → Default Starter Kit policy and save.
  • Run the outbox cron (or wait), then verify both remote profiles received an Update (e.g. via the outbox endpoint or a debug log on the receiving instance): the actors' interactionPolicy.canFeature.automaticApproval reflects the new policy.
  • Switch the actor mode to blog-only and change the policy again: only the blog actor gets an Update.

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.
Copilot AI review requested due to automatic review settings June 12, 2026 14:47
@pfefferle pfefferle added the Enhancement New feature or request label Jun 12, 2026
@pfefferle pfefferle self-assigned this Jun 12, 2026
@pfefferle pfefferle added the Enhancement New feature or request label Jun 12, 2026
@pfefferle pfefferle requested a review from a team June 12, 2026 14:47

Copilot AI left a comment

Copy link
Copy Markdown

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 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_policy to 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 thread includes/scheduler/class-actor.php
Comment thread tests/phpunit/tests/includes/scheduler/class-test-actor.php
Comment thread tests/phpunit/tests/includes/scheduler/class-test-actor.php

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

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' ) );

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@pfefferle pfefferle merged commit dcbb961 into trunk Jun 12, 2026
11 checks passed
@pfefferle pfefferle deleted the update/starter-kit-policy-profile-updates branch June 12, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants