Repository navigation
feat(thread): add message body to thread reads - #18
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /me/threads/:rootMessageId(readMailboxThreadByMessageId) andreadMailboxThreadnow returnbody: stringon eachMailboxThreadMessage— the same full textMailboxMessageDetailSchema(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.rawcolumn 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 decodesraw, 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/mailboxto0.2.0(minor, additive schema field).Test plan
src/thread.test.tswith a body-decoding test forreadMailboxThreadand forreadMailboxThreadByMessageId(root + reply, each with distinct bodies).bun run typecheckpasses forsrc(pre-existing unrelated errors inexamples/reference-host, gated on a builtdist/).bun run test(Postgres on :5433, dbmailbox_core): 420 pass, 0 fail.