Files
sharedinbox/lib/core/db_schema_version.dart
T
Thomas SharedInboxandClaude Sonnet 4.6 af2abdb7f6 fix: include mailboxPath in IMAP email ID to prevent UID collisions
IMAP UIDs are mailbox-scoped, so UID 50 in INBOX and UID 50 in Archive
are different emails. The old ID scheme `accountId:uid` caused silent
overwrites via insertOnConflictUpdate. The new scheme is
`accountId:mailboxPath:uid`.

Schema migration v41 re-derives IDs for existing IMAP email rows from
the (account_id, mailbox_path, uid) columns already stored, updates the
email_bodies foreign key accordingly, patches thread_id fields that
were set to the email's own ID (no Message-ID header), and rebuilds the
threads table from the corrected email rows.

Closes #502

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06 23:56:52 +02:00

2 lines
32 B
Dart

const int dbSchemaVersion = 41;