From 921382a9bfec02525cd24e66b2598a27ddcb6020 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Tue, 30 Aug 2022 10:28:46 -0500 Subject: maildir: do not send dircontents on fs event The maildir worker watches the file system for events (new mail, moved mail, copied mail, etc). On an event, the worker sends a DirectoryContents message and a DirectoryInfo message. Do not send DirectoryContents on FS Event in the maildir worker. The DirectoryInfo message already triggers the UI to request the new DirectoryContents, and does so in a more predictable way (IE any currently applied filter is applied). Signed-off-by: Tim Culverhouse Acked-by: Robin Jarry --- worker/maildir/worker.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go index e85caacc..0ece323b 100644 --- a/worker/maildir/worker.go +++ b/worker/maildir/worker.go @@ -115,19 +115,6 @@ func (w *Worker) handleFSEvent(ev fsnotify.Event) { return } - uids, err := w.c.UIDs(*w.selected) - if err != nil { - logging.Errorf("could not scan UIDs: %w", err) - return - } - sortedUids, err := w.sort(uids, w.currentSortCriteria) - if err != nil { - logging.Errorf("error sorting directory: %w", err) - return - } - w.worker.PostMessage(&types.DirectoryContents{ - Uids: sortedUids, - }, nil) dirInfo := w.getDirectoryInfo(w.selectedName) w.worker.PostMessage(&types.DirectoryInfo{ Info: dirInfo, -- cgit