From f7f2e7c70b06b7baea735a333e93c131a9026b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Br=C3=A5then?= Date: Sun, 21 Jun 2026 18:23:37 +0200 Subject: [PATCH] fix(folder): check if context canceled when scanning (fixes #10363) (#10757) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During initial folder scan and the scan is interrupted with a context.Canceled error, it was previously logged as a "Failed initial scan" error, which can be misleading The change adds a explicit check for context.Canceled and silently ignores it (fixes #10363) Signed-off-by: Henrik BrĂ¥then --- lib/model/folder.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/model/folder.go b/lib/model/folder.go index e61a706eb..dd910494a 100644 --- a/lib/model/folder.go +++ b/lib/model/folder.go @@ -975,10 +975,13 @@ func (f *folder) scanTimerFired(ctx context.Context) error { select { case <-f.initialScanFinished: default: - if err != nil { - f.sl.ErrorContext(ctx, "Failed initial scan", slogutil.Error(err)) - } else { + switch { + case err == nil: f.sl.InfoContext(ctx, "Completed initial scan") + case errors.Is(err, context.Canceled): + // Suppressed: context was canceled (e.g. by user) + default: + f.sl.ErrorContext(ctx, "Failed initial scan", slogutil.Error(err)) } close(f.initialScanFinished) }