aboutsummaryrefslogtreecommitdiffstats
path: root/worker/imap/extensions
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2024-01-20 11:31:03 +0100
committerRobin Jarry <robin@jarry.cc>2024-01-25 21:55:17 +0100
commit1980744f7bf9e147abf649d37a2fa7dddd4e7254 (patch)
treedba9967e81d4c65c287dd5c9c1e26c5f269891b7 /worker/imap/extensions
parent3452c9233f623c4049098b66911ae82fc14e119c (diff)
downloadaerc-1980744f7bf9e147abf649d37a2fa7dddd4e7254.tar.gz
idler: improve the imap idler
Rewrite the imap idler to make it more fault tolerant and prevent hangs (and possibly short writes). Fixes: https://todo.sr.ht/~rjarry/aerc/208 Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/imap/extensions')
-rw-r--r--worker/imap/extensions/xgmext/client.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/worker/imap/extensions/xgmext/client.go b/worker/imap/extensions/xgmext/client.go
index 3107e642..62d081b2 100644
--- a/worker/imap/extensions/xgmext/client.go
+++ b/worker/imap/extensions/xgmext/client.go
@@ -46,7 +46,13 @@ func (h handler) fetchThreadIds(uids []uint32) ([]string, error) {
go func() {
defer log.PanicHandler()
for msg := range messages {
- m[msg.Items[thriditem].(string)] = struct{}{}
+ if msg == nil {
+ continue
+ }
+ item, ok := msg.Items[thriditem].(string)
+ if ok {
+ m[item] = struct{}{}
+ }
}
done <- nil
}()