Anthony d3b0f4a077 Decouple folder/list sync from body prefetch
The syncer ran one loop: phase 1 (folder list + mail-id lists) then
phase 2 (body prefetch). On a large mailbox the cold prefetch pass takes
many minutes, so the next folder refresh was stuck behind it and new
folders/mail only showed up after a restart.

Split into two independent loops sharing the store: a fast list_sync_loop
(folder list + mail ids, ~every SYNC_INTERVAL) and a slow prefetch_loop
(bodies, background). Folder and new-mail refresh no longer wait on
prefetch.

Live-tested: a folder created while the bridge runs appears over IMAP in
~18s, no restart.
2026-05-27 16:05:11 +02:00
2026-05-27 16:05:11 +02:00
Languages
Rust 89.5%
TypeScript 5.9%
CSS 2.5%
Python 1.2%
Shell 0.7%
Other 0.1%