Files
warmbly/internal
SUMAN JANA 04d73acafd fix(worker): reconnect dropped IMAP sessions and sync nested Gmail folders
The worker opened one IMAP session per mailbox at load and never re-dialed.
When the server dropped it (Gmail does after a while), handleError mapped
net.ErrClosed to nil, so every pass ran as a clean "no folders" pass:
nothing logged, no error record, last_synced_at kept moving, no new mail
for days, and sent copies failed with "use of closed network connection".

- imap.Client: ensureConnected re-dials a client parked in Logout state;
  every entry point (Folders, AppendToSent, warmup actions) runs through it.
- handleError: transport errors return a retryable server-unreachable
  error instead of nil, so the sync loop logs and retries.
- Folders: LIST "*" instead of "%", which stopped at the top level and
  never reached [Gmail]/Sent Mail (or Dovecot's INBOX.*); request
  SPECIAL-USE, without which Gmail reports no \Sent/\Trash/\Junk/\All.
- Sync: skip Gmail's virtual label views (All Mail, Starred, Important)
  so known mail is not re-filed as archive under a different UID; retire
  a cursor an earlier build baselined for them. "Bin" is trash.
2026-09-07 06:44:54 +00:00
..
2026-01-17 14:11:14 +00:00