diff options
author | Koni Marti <koni.marti@gmail.com> | 2024-01-20 11:31:03 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-01-25 21:55:17 +0100 |
commit | 1980744f7bf9e147abf649d37a2fa7dddd4e7254 (patch) | |
tree | dba9967e81d4c65c287dd5c9c1e26c5f269891b7 /worker/imap/extensions | |
parent | 3452c9233f623c4049098b66911ae82fc14e119c (diff) | |
download | aerc-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.go | 8 |
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 }() |