Fix update notifications and clear update cache
Handle hotfix upgrade messaging and clear stale update state after applying updates. - UpdateController: when notifying admins for hotfixes, pass the current app version as the "to" version so notifications read e.g. "v1.1.3 has been updated" instead of showing a commit SHA. - NotificationService: adjust system upgrade message to show a simple "has been updated" message when fromVersion equals toVersion (hotfix/file updates) and standard "upgraded from X to Y" otherwise; factor migration label formatting. - UpdateService: clear cached update-check state after a successful update (add clearUpdateCache method) so the UI no longer shows a stale "update available" card. Keep latest_available_version unchanged to avoid view inconsistencies before migrations run.
This commit is contained in:
@@ -115,9 +115,13 @@ class UpdateController extends Controller
|
||||
if (!$hasMigrations) {
|
||||
try {
|
||||
$notificationService = new NotificationService();
|
||||
// For hotfixes the "to_version" is a commit SHA (e.g. "4371f17"),
|
||||
// not a semver string. Pass the current app version so the
|
||||
// notification reads "v1.1.3 has been updated" instead of "v4371f17".
|
||||
$notifyToVersion = ($type === 'hotfix') ? $fromVersion : $toVersion;
|
||||
$notificationService->notifyAdminsUpgrade(
|
||||
$fromVersion,
|
||||
$toVersion,
|
||||
$notifyToVersion,
|
||||
0,
|
||||
!empty($result['composer_manual_required'])
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user