Skip to content

feat: expose CC and BCC recipients in message API#242

Open
danshapiro wants to merge 1 commit intowesm:mainfrom
danshapiro:expose-cc-bcc-in-api
Open

feat: expose CC and BCC recipients in message API#242
danshapiro wants to merge 1 commit intowesm:mainfrom
danshapiro:expose-cc-bcc-in-api

Conversation

@danshapiro
Copy link
Copy Markdown

Summary

  • The message_recipients table already stores cc and bcc recipient types from Gmail sync (215K CC rows, 4.5K BCC rows in production), but the API only returned to recipients
  • Adds cc and bcc fields to MessageSummary (omitted from JSON when empty)
  • Populates them via the existing batchGetRecipients / getRecipients helpers for both list and detail endpoints
  • Refactors ListMessages to use batchPopulate (like SearchMessages already does) to avoid duplicating batch-loading logic

Test plan

  • All existing tests pass (go test ./internal/store/... ./internal/api/...)
  • Verify CC/BCC appears in /api/v1/messages list response for messages with CC recipients
  • Verify CC/BCC appears in /api/v1/messages/{id} detail response
  • Verify messages without CC/BCC omit the fields (omitempty)

🤖 Generated with Claude Code

The message_recipients table already stores cc and bcc recipient types
from Gmail sync (215K CC rows, 4.5K BCC rows), but the API only
returned "to" recipients. This adds cc and bcc fields to
MessageSummary and populates them via the existing batchGetRecipients
and getRecipients helpers.

Also refactors ListMessages to use batchPopulate (like SearchMessages
already does) to avoid duplicating the batch-loading logic.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Apr 3, 2026

roborev: Combined Review (c6db1dc)

Verdict: No medium-or-higher findings; the change looks clean.

The reviewed changes consistently appear to safely extend message API responses to include cc and bcc recipients in both single-message and batched retrieval paths, with no concrete correctness or security issues identified.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

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