Conversation
Pass $limit, $before_date, and $after_date as additional arguments to the mastodon_api_notifications_get filter so handlers can fetch only the relevant pagination window. Backward compatible — existing two-argument handlers are unaffected. Also register ap_outbox post type at init priority 0 in the test bootstrap so it is available before Migration::init() (priority 1) runs, preventing a doing_it_wrong notice on fresh installs. Fixes test inject filter priority (5 → 50) so it runs after the ActivityPub integration handler (priority 10), which was incorrectly truncating the shared notification pool before finalize_notifications() could paginate it.
Pass $limit, $before_date, and $after_date as additional arguments to the mastodon_api_notifications_get filter so handlers can fetch only the relevant pagination window. Backward compatible — existing two-argument handlers are unaffected. Also register ap_outbox post type at init priority 0 in the test bootstrap so it is available before Migration::init() (priority 1) runs, preventing a doing_it_wrong notice on fresh installs. Move the test inject filter to priority 50 (after real handlers, before finalize_notifications at 100) so it is not truncated by the ActivityPub integration handler at priority 10. Add PHP 8.3 and 8.4 to the CI matrix and check out the ActivityPub plugin as a sibling for PHP >= 8.1 to test the combination.
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.
Changes
mastodon_api_notifications_getfilter — new optional argumentsPasses
$limit,$before_date, and$after_dateas additional arguments (3rd, 4th, 5th) to the filter. Backward compatible — existing two-argument handlers are unaffected.This allows handlers to fetch only notifications within the current pagination window rather than fetching a fixed number from the top and truncating the shared pool. See the companion PR to the ActivityPub plugin (Automattic/wordpress-activitypub#3150) which uses these to fix pagination for reblog/like/follow notifications.
Test bootstrap —
ap_outboxnotice fixRegisters
ap_outboxpost type atinitpriority 0 so it is available beforeMigration::init()(priority 1) runs on fresh installs, preventing adoing_it_wrongnotice during tests.Test inject filter priority 5 → 50
The ActivityPub integration hooks into
mastodon_api_notifications_getat priority 10 and was truncating the accumulated array to$limitbefore returning. Moving the test inject filter to priority 50 (after all real handlers, beforefinalize_notificationsat 100) ensures the test pool is not clipped.CI matrix — PHP 8.3, 8.4 and ActivityPub combination tests
Adds PHP 8.3 and 8.4 to the test matrix. Checks out the ActivityPub plugin as a sibling directory for PHP >= 8.1 so the combination is tested on CI.