From 48d6e6a54b9d857eb5f3e1824300389d142b7c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 25 Nov 2025 10:43:22 +0100 Subject: [PATCH] fix(updatenotification): Fix log spam from ResetToken job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- .../lib/BackgroundJob/ResetToken.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/updatenotification/lib/BackgroundJob/ResetToken.php b/apps/updatenotification/lib/BackgroundJob/ResetToken.php index 9e700bc93acb1..f0fc992546b79 100644 --- a/apps/updatenotification/lib/BackgroundJob/ResetToken.php +++ b/apps/updatenotification/lib/BackgroundJob/ResetToken.php @@ -43,7 +43,17 @@ protected function run($argument) { return; } - $secretCreated = $this->appConfig->getValueInt('core', 'updater.secret.created'); + $secretCreated = $this->appConfig->getValueInt('core', 'updater.secret.created', 0); + + if ($secretCreated === 0) { + if ($this->config->getSystemValueString('updater.secret') !== '') { + $this->logger->error('Cleared old `updater.secret` with unknown creation date', ['app' => 'updatenotification']); + $this->config->deleteSystemValue('updater.secret'); + } + $this->logger->debug('Skipping `updater.secret` reset since there is none', ['app' => 'updatenotification']); + return; + } + // Delete old tokens after 2 days and also tokens without any created date $secretCreatedDiff = $this->time->getTime() - $secretCreated; if ($secretCreatedDiff >= 172800) {