mirror of
https://git.sr.ht/~rjarry/aerc
synced 2026-03-02 18:23:33 +01:00
This is an alternative to96ccb183that 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>