From a890fcb435e223897e9cacd92fc95673af45fb81 Mon Sep 17 00:00:00 2001 From: Bence Ferdinandy Date: Thu, 11 Jul 2024 11:34:18 +0200 Subject: maildir: only abort directory listing if there are 0 uids If there is an error in container.UIDs, we will abort handling the message list, resulting in showing the number of messages by the directory name, but having an empty message list showing. Only return with err, if UIDs actually returned 0 messages. References: https://todo.sr.ht/~rjarry/aerc/215 Signed-off-by: Bence Ferdinandy Acked-by: Robin Jarry --- worker/maildir/worker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go index c733ddc6..7ff5093d 100644 --- a/worker/maildir/worker.go +++ b/worker/maildir/worker.go @@ -554,7 +554,7 @@ func (w *Worker) handleFetchDirectoryThreaded( } } else { uids, err = w.c.UIDs(*w.selected) - if err != nil { + if err != nil && len(uids) == 0 { w.worker.Errorf("failed scanning uids: %v", err) return err } -- cgit