[6.x] Fix incorrect update badges in the Control Panel updater#14890
[6.x] Fix incorrect update badges in the Control Panel updater#14890aaronbushnell wants to merge 2 commits into
Conversation
…ketplace latest The update check treated "not exactly equal to the marketplace's latest" as "an update is available", rather than "the installed version is older than the latest". This surfaced an "Update available" badge whenever a local install was ahead of the marketplace's indexed version (e.g. in the window between a release landing on Packagist and the marketplace indexing it). - Addon::isLatestVersion() now uses `>=` instead of strict equality, so an install equal to or newer than the marketplace latest is up to date. - The per-product updater badge derives "up to date" from the changelog's release types (no `upgrade` releases) instead of a string comparison, matching the server's classification and the count badge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Experiencing this also on 6.24.1. Same story on my end with three Alt Design addons that are each one release ahead of the marketplace's latest_version (alt-inbound 2.0.1 vs 2.0.0, alt-redirect 1.8.0 vs 1.7.0, alt-seo 1.4.2 vs 1.4.1). Result: a stuck "3" on the Updates badge while the Updates page happily says everything's up to date. Your fix sorts it. |
|
Thanks for the PR! The underlying issue should now be fixed on the Marketplace side — see my comment here: #10277 (comment). I've leave it to @jasonvarga to decide whether it's still worth merging this as an extra safeguard. |
|
Thanks, @duncanmcclean! This might also be useful if and when future beta versions of Statamic (or addons) are installed, but the CMS shows there are "updates". Since you're not on the same version as what's in the Marketplace you might still see those badges notifying you to make an update. |
The "Up to date" and "Security update available" header badges were derived from the current changelog page. Paginating past page 1 (which holds the newest, upgrade-typed releases) left only older releases, so both badges dropped incorrectly. Return onLatestVersion and securityUpdateAvailable from the changelog endpoint, computed across the full release set, and bind them directly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The CP shows a false "Update available" when the installed version is newer than the marketplace's indexed
latest_version. This happens routinely in the gap between a release hitting Packagist (installable via Composer) and statamic.com indexing it.Example:
statamic/seo-proinstalled at7.12.1, marketplacelatest_versionstill7.12.0→ amber "Update available" badge shown, and it's counted in the updates badge.What was altered:
Addon::isLatestVersion():'='→'>='. Equal-or-newer is up to date.Updater.vue: derive "up to date" from the changelog (no releases oftype === 'upgrade') instead of string equality. This reuses the server's existing release classification, so the per-product badge now agrees with the count badge.Related