gmail: keep every message for search, and search it locally

Only JMAP accounts filled the corpus, so a Gmail search always went to Gmail: a second's pause before it asked, ten threads at most, and whole-word matching only. Harvest walks messages.list from the top each run once the backfill is done, reading whole each message the corpus lacks (messages.get, 60 units), or its thread when the corpus lacks more than one of it (threads.get, 120). It shares the backfill's two fifths of the quota: it waits while the backfill walks and while the user's requests are out, and waits 25 ms per quota unit after each answer. Once a walk has reached the bottom, a walk ends at the first page the corpus has all of, and searches the index can answer are answered by it, reading the threads not loaded, as JMAP accounts do. The history now also names deleted messages, which the corpus drops. Contacts are not gathered from the corpus: the backfill's thread reads already note the people on the same mail.


Author rockorager.dev
Date Commit Parent 713b9cd0
+755 -32
5 changed files
+755 -32
5 changed files