email: fix backfill crash on emails with no Reply-To; Sync now retries errored mailboxes (v0.1.0:62)

insert_email's recipients loop did `for a in parsed.get(kind, [])`, but the parser sets
reply_to=None when there is no Reply-To header, so .get returns None (key present) and the
loop raised 'NoneType' object is not iterable — aborting the entire Gmail backfill on the
first such email (i.e. almost immediately). Fixed with `or []`. Regression test
test_insert_email.py (reply_to=None, all-None recipients, happy path).

Because the scheduler intentionally skips error-status accounts (no retry storms), an
errored mailbox would never resume on its own. "Sync now" now clears error status first,
so it is an explicit retry; backfill resumes from its saved cursor and dedups by
Message-ID, so nothing is re-captured.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Keysat
2026-06-06 12:41:06 -05:00
parent 2cb476e36b
commit ea036f49a6
6 changed files with 126 additions and 5 deletions
+3 -2
View File
@@ -26,8 +26,9 @@ export const PACKAGE_TITLE = 'Ten31 Database'
// * 0.1.0:58 (seed 5 Architect positioning framings into the Workshop as candidate options)
// * 0.1.0:59 (Email Capture admin panel + matched email into the grounding corpus)
// * 0.1.0:60 (Email Capture: single-mailbox enroll field for testing)
// * Current: 0.1.0:61 (Email Capture: live backfill progress + auto-refresh)
export const PACKAGE_VERSION = '0.1.0:61'
// * 0.1.0:61 (Email Capture: live backfill progress + auto-refresh)
// * Current: 0.1.0:62 (fix backfill crash on no-Reply-To emails; Sync now retries errored mailboxes)
export const PACKAGE_VERSION = '0.1.0:62'
export const DATA_MOUNT_PATH = '/data'
export const WEB_PORT = 8080