~rjarry/aerc-devel

aerc: imap: drain updates channel when moving messages v1 APPLIED

Koni Marti: 1
 imap: drain updates channel when moving messages

 1 files changed, 3 insertions(+), 0 deletions(-)
#1157737 alpine-edge.yml success
#1157738 openbsd.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rjarry/aerc-devel/patches/49815/mbox | git am -3
Learn more about email & git

[PATCH aerc] imap: drain updates channel when moving messages Export this patch

Drain the updates channel when moving messages to prevent a backend
freeze. This also fixes a possible freeze for large-scale archive
operations since the archive command uses the move operation.

Reported-by: Moritz Poldrack <moritz@poldrack.dev>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
---
 worker/imap/movecopy.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/worker/imap/movecopy.go b/worker/imap/movecopy.go
index d3df133a..58357a45 100644
--- a/worker/imap/movecopy.go
+++ b/worker/imap/movecopy.go
@@ -48,6 +48,9 @@ func (imapw *IMAPWorker) handleAppendMessage(msg *types.AppendMessage) {
}

func (imapw *IMAPWorker) handleMoveMessages(msg *types.MoveMessages) {
	drain := imapw.drainUpdates()
	defer drain.Close()

	uids := toSeqSet(msg.Uids)
	if err := imapw.client.UidMove(uids, msg.Destination); err != nil {
		imapw.worker.PostMessage(&types.Error{
-- 
2.44.0
aerc/patches: SUCCESS in 2m13s

[imap: drain updates channel when moving messages][0] from [Koni Marti][1]

[0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/49815
[1]: mailto:koni.marti@gmail.com

✓ #1157737 SUCCESS aerc/patches/alpine-edge.yml https://builds.sr.ht/~rjarry/job/1157737
✓ #1157738 SUCCESS aerc/patches/openbsd.yml     https://builds.sr.ht/~rjarry/job/1157738
Works like a charm

Tested-by: Moritz Poldrack <moritz@poldrack.dev>

-- 
Moritz Poldrack
https://moritz.sh
Works great, thank you!

Tested-by: Jeremy Baxter <jtbx@disroot.org>
Koni Marti <koni.marti@gmail.com> wrote: