aerc/worker/imap
Robin Jarry 5dec1f09b1 imap: fix error when server returns a message without body section
When opening unread emails from certain people (I won't name any names,
sorry), an annoying error message is displayed on the status line:

 could not get section &imap.BodySectionName{BodyPartName:
 imap.BodyPartName{Specifier:"", Path:[]int(nil), Fields:[]string(nil),
 NotFields:false}, Peek:false, Partial:[]int(nil), value}

This does not occur for already read messages. This issue is similar to
the one that was fixed in commit 8ed95b0d2a ("imap: avoid crash when
replying to unread message").

This happens because the flags are updated in the callback that receives
the message itself. It causes the flag update to arrive in the same
channel/request. Ignore the messages that have an empty body (i.e. only
containing flag updates). This is inherently racy but there seems no way
to get rid of these extra messages.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Koni Marti <koni.marti@gmail.com>
2022-07-23 21:51:47 +02:00
..
cache.go imap: add option to cache headers 2022-06-22 11:26:13 +02:00
checkmail.go threading: add backend capabilities to workers 2022-07-10 21:15:12 +02:00
configure.go imap: add option to cache headers 2022-06-22 11:26:13 +02:00
connect.go imap: add timeout to tcp connect functions 2022-05-04 14:07:15 +02:00
create.go go vet: composite literal uses unkeyed fields 2022-03-18 13:33:16 +01:00
fetch.go imap: fix error when server returns a message without body section 2022-07-23 21:51:47 +02:00
flags.go imap: fix data race on seqMap array 2022-06-24 21:08:12 +02:00
idler.go imap: add debouncer to the idler 2022-05-04 14:07:15 +02:00
imap.go go.mod: change base git url 2021-11-05 10:21:45 +01:00
list.go logging: added a log on panic 2022-03-23 20:56:09 +01:00
movecopy.go dirlist: update RUE counts for imap/maildir on move|copy|delete|archive 2022-06-07 16:19:23 +02:00
observer.go imap: monitor the logout channel with an observer 2022-05-04 14:07:15 +02:00
open.go threading: enable filtering of server-side threads 2022-07-10 21:15:12 +02:00
remove.go go vet: composite literal uses unkeyed fields 2022-03-18 13:33:16 +01:00
search.go threading: enable filtering of server-side threads 2022-07-10 21:15:12 +02:00
seqmap.go imap: fix data race on seqMap array 2022-06-24 21:08:12 +02:00
seqmap_test.go imap: fix data race on seqMap array 2022-06-24 21:08:12 +02:00
worker.go threading: add backend capabilities to workers 2022-07-10 21:15:12 +02:00