Handle hotfix updates and stale commit cache
Treat file-only/hotfix updates (identified by commit SHA) as non-version changes and clear stale commit-cache so the UI no longer reports an available update after a hotfix. UpdateService now clears commits_behind_count and latest_remote_sha when no new commits are found. LayoutHelper and settings view consider installed_commit_sha vs latest_remote_sha and set commitsBehind to 0 when they match. NotificationService detects commit SHAs for the target version and emits a clearer "hotfix {sha}" message for file-only updates.
This commit is contained in:
@@ -38,6 +38,12 @@ $currentVer = $appSettings['app_version'] ?? '0';
|
||||
$latestVer = $updateSettings['latest_available_version'] ?? null;
|
||||
$updateChannel = $updateSettings['update_channel'] ?? 'stable';
|
||||
$commitsBehind = (int)($updateSettings['commits_behind_count'] ?? 0);
|
||||
$installedSha = $updateSettings['installed_commit_sha'] ?? '';
|
||||
$remoteSha = $updateSettings['latest_remote_sha'] ?? '';
|
||||
// If installed SHA matches remote SHA, there's no real hotfix — stale cache
|
||||
if ($installedSha !== '' && $remoteSha !== '' && str_starts_with($installedSha, $remoteSha)) {
|
||||
$commitsBehind = 0;
|
||||
}
|
||||
if ($latestVer && version_compare($latestVer, $currentVer, '>')) {
|
||||
$cachedUpdateAvailable = true;
|
||||
$cachedUpdateData = [
|
||||
|
||||
Reference in New Issue
Block a user