Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/changelog/2771-from-description
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix migration activities not being scheduled for federation due to hook registration timing.
3 changes: 2 additions & 1 deletion activitypub.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ function plugin_init() {
\add_action( 'init', array( __NAMESPACE__ . '\Options', 'init' ) );
\add_action( 'init', array( __NAMESPACE__ . '\Post_Types', 'init' ) );
\add_action( 'init', array( __NAMESPACE__ . '\Router', 'init' ) );
\add_action( 'init', array( __NAMESPACE__ . '\Scheduler', 'init' ) );
// Priority 0 ensures Scheduler hooks are registered before Migration (priority 1) runs.
\add_action( 'init', array( __NAMESPACE__ . '\Scheduler', 'init' ), 0 );
\add_action( 'init', array( __NAMESPACE__ . '\Search', 'init' ) );
\add_action( 'init', array( __NAMESPACE__ . '\Signature', 'init' ) );

Expand Down
4 changes: 2 additions & 2 deletions includes/class-scheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ public static function cleanup_remote_actors() {
* Schedule the outbox item for federation.
*
* @param int $id The ID of the outbox item.
* @param int $offset The offset to add to the scheduled time.
* @param int $offset The offset to add to the scheduled time. Default 3 seconds.
*/
public static function schedule_outbox_activity_for_federation( $id, $offset = 0 ) {
public static function schedule_outbox_activity_for_federation( $id, $offset = 3 ) {
Comment on lines +277 to +279
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is the delay necessary even after the priority switch?

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.

I have no idea tbh! This is so hard to debug!

$hook = 'activitypub_process_outbox';
$args = array( $id );

Expand Down