about summary refs log tree commit homepage
path: root/t/lei-refresh-mail-sync.t
DateCommit message (Collapse)
2021-11-02t/lei-refresh-mail-sync: speed up test on FreeBSD 12
And improve reliability while we're at it. It seems closing a TCP listen socket on FreeBSD 12.2 doesn't cause connect()-ing clients to fail. This happens regardless of whether a socket is IPv4 or IPv6 This non-failure was causing tests to timeout slowly on the client side instead of failing immediately. We now fork a new process which does nothing but accept() + shutdown() to emulate a dead server. Reliability improves on all OSes since there's never a point in time when another process can bind the socket.
2021-09-19t/lei-refresh-mail-sync: improve test reliability
We can't assume -imapd will be ready by the time we try to connect to it after restart when using "-l $ADDR". So recreate the (closed-for-testing) listen socket in the parent and hand it off to -imapd as we do normally
2021-09-17lei refresh-mail-sync: drop old IMAP folder info
Like with Maildir, IMAP folders can be deleted entirely. Ensure they can be eliminated, but don't be fooled into removing them if they're temporarily unreachable.
2021-09-17lei refresh-mail-sync: implicitly remove missing folders
There's no point in keeping mail_sync.sqlite3 entries around if the folder is gone. We do keep saved-search configs around, however, since somebody may decide to blow away a search and start over.
2021-09-17lei refresh-mail-sync: replace prune-mail-sync
Merely pruning mail synchronization information was insufficient for Maildir: renames are common in Maildir and we need to detect them after-the-fact when lei-daemon isn't running. Running this command could make "lei index" far more useful... v2: close R/O mail_sync.sqlite3 dbh before fork Keeping the DB file handle open across fork can cause bad things to happen even if we don't use it since sqlite3 itself still knows about it (but doesn't know Perl code doesn't know about it).