]> Sergey Matveev's repositories - public-inbox.git/commit
lei import: avoid IMAPTracker, use LeiMailSync more
authorEric Wong <e@80x24.org>
Thu, 29 Apr 2021 09:46:18 +0000 (09:46 +0000)
committerEric Wong <e@80x24.org>
Fri, 30 Apr 2021 06:41:36 +0000 (06:41 +0000)
commit923e09d84e8eaa612c85f6d5ec57c3742390bebc
tree2d948ad486cdbb74744f678518e65fe34816809b
parent64886302aea5b329a1ec0227d209c14b4a5dda96
lei import: avoid IMAPTracker, use LeiMailSync more

IMAPTracker has a UNIQUE constraint on the `url' column,
which may cause compatibility and/or rollback problems
in attempting to deal with UIDVALIDITY changes.

Having multiple sources of truth leads to confusion and bugs,
so relying on LeiMailSync exclusively ought to simplify things.

Furthermore, since LeiMailSync is only written to by LeiStore,
it is safer in that it won't mark a UID or article as imported
until git-fast-import has seen it, and the SQLite commit always
happens after "done\n" is sent to fast-import.

This mostly reverts recent commits to IMAPTracker to support
lei, those are:

1) commit 7632d8f7590daf70c65d4270e750c36552fa9389
   ("net_reader: restart on first UID when UIDVALIDITY changes")
2) commit 311a5d37ad275cd75b1e64d87827c4d13fe4bfab
   ("imap_tracker: prepare for use with lei").

This means public-inbox-watch will not change between 1.6 and
1.7: -watch stops synching a folder when UIDVALIDITY changes.
Documentation/lei-store-format.pod
lib/PublicInbox/IMAPTracker.pm
lib/PublicInbox/LEI.pm
lib/PublicInbox/LeiImport.pm
lib/PublicInbox/LeiInput.pm
lib/PublicInbox/LeiMailSync.pm
lib/PublicInbox/NetReader.pm
lib/PublicInbox/URIimap.pm
t/lei-import-imap.t
t/lei-import-nntp.t