[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>
---
Acked-by: Robin Jarry <robin@jarry.cc>
Applied, thanks.
To git@git.sr.ht:~rjarry/aerc
8543aec8f12c..66bbc5303578 master -> master
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: