Add schema v5: source ids, mailbox lists, versioned ids and the move change #62
No reviewers
Labels
No labels
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:go
svd:hold
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/mail-mind-mcp!62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/schema-v5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #54 (epic #51, ADR 0006 §4 to §6). IMAP rows and IMAP ids do not change.
Schema v5
messages.source_id, unique per account where not null, andmessages.mailboxes, a JSON list.source_idonchangesandwakes, so a change row or a wake row can name a stable id.ALTER TABLEand then creates the index.ADD COLUMNof a nullable column does not rewrite the table, so a large mirror upgrades at once. The reader waits for v5 as before.Ids (
ids.py, new)~s1/<account>/<source_id>. Account ids match^[a-z0-9][a-z0-9_-]{0,63}$, so no IMAP id can start with the tag, and the config needs no new refusal.ids.lookupresolves either form. Every encode and decode inserver.pynow goes throughids.py. The write paths (draft_id, moved ids) keep the IMAP form until #57.Store
get_by_source.record_move, which moves a stable-id row in place and logsmove.mail_searchmailbox filter also matches any entry inmailboxes.addanddelchanges carrysource_id.update_flagsanddelete_uidsare still keyed by uid. #55 adds source-keyed variants when the JMAP source needs them.Tools and docs
mail_changesdocstring and the README namemoveand say that a move keeps the id.ids.py.Tests
tests/test_ids.pycovers:mail_changes,mail_read,mail_searchandmail_thread.make checkpasses 144 tests.make test-integrationpasses 8.🤖 Generated with Claude Code