Repository navigation
Rebuild the package manifest when retrying provider loading - #265
LukeTowers wants to merge 1 commit into
Conversation
`clearPackageCache()` reset `PackageManifest::$manifest` to an empty array, but `getManifest()` short-circuits on `! is_null()`, so the retry ran against an empty manifest instead of rebuilding it from the installed packages. With `app.loadDiscoveredPackages` enabled that dropped every discovered provider, and swallowed the original exception along with it, so a genuinely broken provider looked like a clean boot.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Walkthrough
Estimated code review effort Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to
|
registerConfiguredProviders()clears the package, service and class caches and retries once when provider loading fails — added in 6eef811 to recover from a cached provider that Composer has since removed, "emulating someone runningphp artisan config:clearbeforephp artisan package:discover. If a failure still occurs, then the failure is made known to the user."Neither happens.
clearPackageCache()resetsPackageManifest::$manifestto an empty array, butgetManifest()short-circuits on! is_null(), so the retry runs against an empty manifest instead of rebuilding it from the installed packages. Withapp.loadDiscoveredPackagesenabled that drops every discovered provider and swallows the original exception, so a broken provider looks like a clean boot. Observed with one discovered provider that throws and one that doesn't:manifest = [](today)manifest = nullregisterConfiguredProviders()provider blew up[]Tests
tests/Foundation/PackageCacheTest.phpbuilds a base path with a realvendor/composer/installed.jsonplus a stalestorage/framework/packages.phpnaming a provider that is no longer installed. All three fail without the change:testClearingThePackageCacheRebuildsTheManifest— direct guard: afterclearPackageCache()the manifest reports the installed package again, not nothing.testProviderLoadingRetryRebuildsTheClearedPackageManifest— the stale provider fails the first load, and the retry registers the discovered one.testProviderLoadingReportsAProviderThatIsStillMissingAfterTheRetry— a provider still missing after the rebuild reaches the caller instead of being swallowed.The last two can only trigger the retry where discovered providers reach the provider repository, so on
wip/1.3they need #255 merged first; the first one passes on either branch.Summary by CodeRabbit