From 30a250bc111009540658a663d82568fd0eb2ab2e Mon Sep 17 00:00:00 2001 From: Dillard Blom Date: Mon, 12 Oct 2026 11:32:42 +0200 Subject: [PATCH] =?UTF-8?q?Stale-backup=20notification:=20"No=20successful?= =?UTF-8?q?=20backup=20to=20=E2=80=A6=20yet"=20instead=20of=20"since=20nev?= =?UTF-8?q?er"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ lib/Notification/Notifier.php | 5 ++++- lib/Service/AlertService.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c25dbc7..820e05b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ instead carried by the app description, the git tag, the release, and this file. - App store listing: the author's e-mail address is shown. - App store listing: the homepage link points to the GitHub repository instead of back to the app store page itself. +- The notification for a location without a successful backup read "No successful backup to … + since never" when there had never been one; it now reads "No successful backup to … yet". ### Fixed - 0.9.4 could not open a repository at the root of an SFTP location (empty path): its faster diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 3cb9dd9..c1d05ae 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -51,7 +51,10 @@ final class Notifier implements INotifier { $notification->setParsedMessage($l->t('Backups stop when the limit is reached. Raise the limit, or let the retention policy remove older backups.')); break; case 'backup_stale': - $notification->setParsedSubject($l->t('No successful backup to %1$s since %2$s', [$p['target'], $p['since']])); + // 'never' was stored by 0.9.4 and earlier + $notification->setParsedSubject(in_array($p['since'] ?? '', ['', 'never'], true) + ? $l->t('No successful backup to %s yet', [$p['target']]) + : $l->t('No successful backup to %1$s since %2$s', [$p['target'], $p['since']])); $notification->setParsedMessage($l->t('Check the backup settings and the server log.')); break; case 'security_event': diff --git a/lib/Service/AlertService.php b/lib/Service/AlertService.php index 817e78a..ace1dc8 100644 --- a/lib/Service/AlertService.php +++ b/lib/Service/AlertService.php @@ -104,7 +104,7 @@ final class AlertService { } $this->appConfig->setValueString(Application::APP_ID, $key, date('Y-m-d')); $this->notifyAdmins('backup_stale', 'stale-' . $target->getId() . '-' . date('Y-m-d'), - ['target' => $target->getName(), 'since' => $last ? date('Y-m-d H:i', $lastTime) : 'never']); + ['target' => $target->getName(), 'since' => $last ? date('Y-m-d H:i', $lastTime) : '']); } private function notifyAdmins(string $subject, string $objectId, array $params): void {