]> Sergey Matveev's repositories - public-inbox.git/commit
net_reader: restart on first UID when UIDVALIDITY changes
authorEric Wong <e@80x24.org>
Fri, 23 Apr 2021 07:28:15 +0000 (07:28 +0000)
committerEric Wong <e@80x24.org>
Fri, 23 Apr 2021 11:23:31 +0000 (07:23 -0400)
commit7632d8f7590daf70c65d4270e750c36552fa9389
tree8dee6f2332d0ecd40251c0fc0e424c0722b9ba52
parent471919dcab4b56b69ed1a90203db41359213fbba
net_reader: restart on first UID when UIDVALIDITY changes

In other words, treat the same IMAP folder with a different
UIDVALIDITY as a completely different folder.  If the UIDVALIDITY
changes, we can start from UID=1 without falling behind or
losing data.  If the UIDVALIDITY gets reset to a previously
known-good message, we can still resume where we left off
before the first UIDVALIDITY change.

This affects public-inbox-watch and "lei import"

One potential downside of this is for rare altid users, but
that's mainly intended for NNTP article numbers which are/were
often publicized; not IMAP UIDs which are rarely publicized.

The other potential downside is bandwidth waste in in the rare
case UIDVALIDITY changes while IMAP folder contents remain
unchanged.  There's no extra storage used due to existing
(v1|v2|lei/store) deduplication mechanisms.

Before this change, we were matching offlineimap behavior and
stopped synching an IMAP folder when its UIDVALIDITY changed.
offlineimap behavior made sense for IMAP <=> Maildir
synchronization since Maildirs had no sense of UIDVALIDITY and
could only rely on name mapping.
lib/PublicInbox/IMAPTracker.pm
lib/PublicInbox/NetReader.pm