Files
aerc-fork-mirror/worker
Simon Martin 8e56e9a3ee imap: dedupe mailboxupdate messages generated by go-imap v1.2.1
This is an alternative to 96ccb183 that was breaking some counters and
had to be reverted.

What triggered the initial patch is the fact that whenever going from
one folder to the other, I noticed that *two* LIST-STATUS were sent to
the server one after the other. They are triggered by MailboxUpdate
notifications by go-imap - 2 generated within the same millisecond (see
comment in the patch as to why).

The initial patch simply ignored those MailboxUpdates, which is actually
wrong: we don't want to have too many, but need at least one. What that
patch does is implement a crude deduplication mechanism that will ignore
any MailboxUpdate received by an IMAP worker within 20ms of the previous
one on the very same worker. The 20ms value is arbitrary, but looks like
a reasonable tradeoff between wrong and missed dedupes - examples of
actual timings can be found in
https://paste.sr.ht/~simartin/923d164d9f80344c91cb287e3272a82e6d2a6eff.

Fixes: 96ccb183 ("remove spurious checkmail when changing directories")
Reported-by: Karel Balej <balejk@matfyz.cz>
Signed-off-by: Simon Martin <simon@nasilyan.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2025-05-05 10:54:36 +02:00
..
2025-03-30 22:10:58 +02:00
2025-03-30 22:10:58 +02:00
2022-10-07 10:51:53 +02:00