From 30ac3f8b8d97044a7e08aa924237ccdcb2ee822e Mon Sep 17 00:00:00 2001 From: Aaron Bushnell Date: Fri, 26 Jun 2026 21:07:09 -0400 Subject: [PATCH] Fix false "Update available" when installed version is newer than marketplace 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) --- resources/js/components/updater/Updater.vue | 2 +- src/Addons/Addon.php | 2 +- tests/Addons/AddonTest.php | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/js/components/updater/Updater.vue b/resources/js/components/updater/Updater.vue index e78019ee218..aecffc16691 100644 --- a/resources/js/components/updater/Updater.vue +++ b/resources/js/components/updater/Updater.vue @@ -92,7 +92,7 @@ export default { }, onLatestVersion() { - return this.currentVersion && this.currentVersion == this.latestVersion; + return this.currentVersion && !this.changelog.some((release) => release.type === 'upgrade'); }, securityUpdateAvailable() { diff --git a/src/Addons/Addon.php b/src/Addons/Addon.php index 64544ea7865..cefc03abaeb 100644 --- a/src/Addons/Addon.php +++ b/src/Addons/Addon.php @@ -419,7 +419,7 @@ public function isLatestVersion() $version = $versionParser->normalize($this->version); $latestVersion = $versionParser->normalize($this->latestVersion()); - return version_compare($version, $latestVersion, '='); + return version_compare($version, $latestVersion, '>='); } public function license() diff --git a/tests/Addons/AddonTest.php b/tests/Addons/AddonTest.php index 5ef50a9be99..795b5a3fb7d 100644 --- a/tests/Addons/AddonTest.php +++ b/tests/Addons/AddonTest.php @@ -342,6 +342,11 @@ public static function isLatestVersionProvider() ['2.0.0', '2.0.0', true], ['1.0', '1.0.0', true], ['1.0', '1.0.1', false], + + // Installed version is newer than the marketplace's indexed latest version + ['1.0.2', '1.0.1', true], + ['2.0.0', '1.0.0', true], + ['7.12.1', '7.12.0', true], ]; }