- insertMessages checks (mailboxId, uid) existence before INSERT, returns only actually inserted records - syncMailbox only runs ThreadReconstructor on newly inserted messages, preventing FK violations from stale UUIDs referencing ignored records - improve error logging to show full error description Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>