~sircmpwn/aerc

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] worker/imap: Fix seqMap race condition

Details
Message ID
<20191110221755.90430-1-keur@xcf.berkeley.edu>
DKIM signature
missing
Download raw message
Patch: +3 -1
When deleting a message, sometimes FetchDirectoryContents will fire.
FetchDirectoryContents will return a smaller set of UIDs since messages
have been deleted. This operation races with fetching from the seqMap in
client.ExpungeUpdate. Only recreate the seqMap if it can grow so that
messages will continue to be expunged.

Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
---
 worker/imap/open.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/worker/imap/open.go b/worker/imap/open.go
index 452c309..0602a7f 100644
--- a/worker/imap/open.go
+++ b/worker/imap/open.go
@@ -40,7 +40,9 @@ func (imapw *IMAPWorker) handleFetchDirectoryContents(
 		}, nil)
 	} else {
 		imapw.worker.Logger.Printf("Found %d UIDs", len(uids))
-		imapw.seqMap = make([]uint32, len(uids))
+		if len(imapw.seqMap) < len(uids) {
+			imapw.seqMap = make([]uint32, len(uids))
+		}
 		imapw.worker.PostMessage(&types.DirectoryContents{
 			Message: types.RespondTo(msg),
 			Uids:    uids,
--
2.24.0
Details
Message ID
<BYCKEQFHXDJT.PBYU21YLISHF@homura>
In-Reply-To
<20191110221755.90430-1-keur@xcf.berkeley.edu> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To git.sr.ht:~sircmpwn/aerc
   0857410..8a84830  master -> master