fix: avoid stale autoload misses during upgrades#7893
Merged
Conversation
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Member
Author
|
/backport to stable34 |
Member
Author
|
/backport to stable33 |
Member
Author
|
/backport to stable32 |
There was a problem hiding this comment.
Pull request overview
This PR addresses upgrade-time autoload failures where Composer can cache previous “class not found” misses within the same PHP process, causing newly introduced migration classes to be reported as “unknown” during upgrades. It introduces an app-level mitigation by rebuilding and re-registering LibreSign’s Composer loader immediately before migrations run, plus regression tests for the scenario.
Changes:
- Add
UpgradeSafeAutoloaderto rebuild the app’sComposer\Autoload\ClassLoaderfrom Composer-generated metadata and reload Composer “files” autoloaders. - Register a new pre-migration repair step
RefreshAutoloaderBeforeMigrationsinappinfo/info.xmlto refresh the loader just before migrations execute. - Add unit tests to cover autoload refresh behavior and same-process upgrade-time autoload miss caching.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/php/Unit/Migration/UpgradeSafeAutoloaderTest.php | Adds regression tests simulating same-process autoload miss caching and validating loader refresh behavior. |
| tests/php/Unit/Migration/RefreshAutoloaderBeforeMigrationsTest.php | Adds unit test coverage for the new pre-migration repair step refreshing the current app loader. |
| lib/Migration/UpgradeSafeAutoloader.php | Implements rebuilding/re-registering a fresh ClassLoader from Composer metadata and re-loading autoload “files”. |
| lib/Migration/RefreshAutoloaderBeforeMigrations.php | Adds a pre-migration repair step that refreshes LibreSign’s autoloader before Nextcloud migrations run. |
| appinfo/info.xml | Registers the new repair step under <pre-migration> to ensure it runs before migrations. |
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This was referenced Jul 13, 2026
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.
Summary
RefreshAutoloaderBeforeMigrationsso the name matches the behaviorFixes #7892.
Testing