aboutsummaryrefslogtreecommitdiffstats
path: root/worker/notmuch/worker.go
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2023-08-30 16:17:55 -0500
committerRobin Jarry <robin@jarry.cc>2023-08-31 17:36:08 +0200
commit31488503aa0edf0962a9d90f5a093d346ea29f06 (patch)
treeabd0fda0df1118f775338a2799da3a49db878810 /worker/notmuch/worker.go
parenta5648c3c0468a27e722159a115a4260c5e84c465 (diff)
downloadaerc-31488503aa0edf0962a9d90f5a093d346ea29f06.tar.gz
notmuch: check context when opening directory
Check for a canceled context when opening a directory with notmuch. The OpenDirectory message carries a context tied to the directory lister - checking for the context error can prevent us from opening a directory that has already been deselected (even after the dirlist-delay period) Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/notmuch/worker.go')
-rw-r--r--worker/notmuch/worker.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go
index 51de6ccb..13733d60 100644
--- a/worker/notmuch/worker.go
+++ b/worker/notmuch/worker.go
@@ -312,6 +312,9 @@ func (w *worker) getDirectoryInfo(name string, query string) *models.DirectoryIn
}
func (w *worker) handleOpenDirectory(msg *types.OpenDirectory) error {
+ if msg.Context.Err() != nil {
+ return context.Canceled
+ }
w.w.Tracef("opening %s", msg.Directory)
var isDynamicFolder bool