Skip to content

[2.x] Fix abandoned-extensions sync never being scheduled#4707

Merged
imorland merged 2 commits into
2.xfrom
im/schedule-abandoned-fix-2x
Jun 11, 2026
Merged

[2.x] Fix abandoned-extensions sync never being scheduled#4707
imorland merged 2 commits into
2.xfrom
im/schedule-abandoned-fix-2x

Conversation

@imorland

Copy link
Copy Markdown
Member

Fixes #4705.

ExtensionServiceProvider registered the extensions:sync-abandoned command and its weekly schedule onto flarum.console.scheduled inside boot(). ConsoleServiceProvider::boot() is what consumes that array to build the Laravel schedule, and it is registered before ExtensionServiceProvider, so the entry was appended too late and the task was never scheduled. The weekly sync therefore never ran and the abandoned-extensions list was never refreshed.

This moves the flarum.console.commands and flarum.console.scheduled registrations into register(), which completes for all providers before any boot(), so the entry is present when the schedule is built. The BisectState setup and Disabling listener stay in boot() as they depend on the boot-injected services.

Adds an integration test asserting extensions:sync-abandoned appears in schedule:list.

This is the 2.x port of #4706.

The sync command was registered onto `flarum.console.scheduled` in
ExtensionServiceProvider::boot(). ConsoleServiceProvider consumes that array
in its own boot() and is registered first, so the entry was appended too
late and the task was never scheduled. Move the command and schedule
registration into register() so it is present when the schedule is built.

Fixes #4705
PHPUnit 12 no longer recognises the @test docblock annotation, so the
test class had no discoverable methods and the run failed with 'No tests
found in class'. Switch to the #[Test] attribute used everywhere else in
the suite.
@imorland imorland merged commit fe376cb into 2.x Jun 11, 2026
25 checks passed
@imorland imorland deleted the im/schedule-abandoned-fix-2x branch June 11, 2026 16:55
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.

[1.x & 2.x] Abandoned-extensions sync is never scheduled (registered in boot() after ConsoleServiceProvider consumes the schedule)

1 participant