Skip to content

feat(thread): add message body to thread reads - #18

Merged
TheGreatAxios merged 1 commit into
mainfrom
thread-message-bodies
Sep 17, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
thread-message-bodies

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • GET /me/threads/:rootMessageId (readMailboxThreadByMessageId) and readMailboxThread now return body: string on each MailboxThreadMessage — the same full text MailboxMessageDetailSchema (read.ts) returns for a single message, decoded from the stored MIME frame. A frame the parser rejects degrades to "" (logged), never a failed read.
  • The body is decoded from a raw column selected in the same scan the thread read already does — no per-row follow-up query. listMailboxThreads (GET /me/threads) is untouched: it never selects or decodes raw, so thread-summary reads stay cheap. (Per scope guidance, no snippet/summary field was added to thread summaries — this repo tracks Interchange's native mailbox/mail-thread model 1:1, and the client derives any snippet from the body it already has.)

Bumps @corbits/mailbox to 0.2.0 (minor, additive schema field).

Test plan

  • Extended src/thread.test.ts with a body-decoding test for readMailboxThread and for readMailboxThreadByMessageId (root + reply, each with distinct bodies).
  • bun run typecheck passes for src (pre-existing unrelated errors in examples/reference-host, gated on a built dist/).
  • bun run test (Postgres on :5433, db mailbox_core): 420 pass, 0 fail.

readMailboxThread and readMailboxThreadByMessageId decode the stored MIME
frame's body in the same scan (no per-row follow-up query) and surface it
on each MailboxThreadMessage, the same body MailboxMessageDetailSchema
returns for a single message. listMailboxThreads is unaffected: it never
selects or decodes raw, so summary reads stay cheap.
@TheGreatAxios
TheGreatAxios merged commit bc96404 into main Sep 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant