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:
@@ -125,6 +125,11 @@ class UpdateService
|
||||
// Cache commit info
|
||||
$this->settingModel->setValue('latest_remote_sha', $result['remote_sha'] ?? '');
|
||||
$this->settingModel->setValue('commits_behind_count', count($commits));
|
||||
} else {
|
||||
// No new commits — explicitly clear stale cache so the UI
|
||||
// doesn't keep showing "update available" after a hotfix was applied.
|
||||
$this->settingModel->setValue('commits_behind_count', '0');
|
||||
$this->settingModel->setValue('latest_remote_sha', '');
|
||||
}
|
||||
} elseif ($channel === 'latest' && !$localSha) {
|
||||
$result['commit_tracking_unavailable'] = true;
|
||||
|
||||
Reference in New Issue
Block a user