Skip to content

feat(gmail): serve search and thread from the local store - #82

Merged
MaximeGaudin merged 1 commit into
mainfrom
feat/gmail-store-first
Sep 14, 2026
Merged

MaximeGaudin merged 1 commit into
mainfrom
feat/gmail-store-first

Conversation

@MaximeGaudin

Copy link
Copy Markdown
Owner

Summary

  • void gmail search still uses Gmail query language (list_messages) but hydrates each id from the local INBOX store when a usable body is already synced, skipping get_message.
  • void gmail thread serves the stored conversation when every message has a usable body; incomplete threads still hit the API.
  • --live skips the store. Store coverage is INBOX-only (in:sent, drafts, extra labels, unsynced mail still go to the network).

Tracks the store-first leftover from #79 (retry already landed in #80).

Test plan

  • void gmail search "newer_than:7d" on a synced INBOX account returns the same JSON as before, with fewer Gmail messages.get calls
  • Same search with --live still hits the API
  • void gmail search --help / void gmail thread --help show --live
  • void gmail thread <id> uses the store for a fully synced thread, and the API when a body is missing/short
  • in:sent / drafts still fetch from the API (not in the INBOX mirror)

Skip get_message/get_thread when the INBOX mirror already has a usable body.
`--live` forces the API. Cuts 1+N reads on a warm store.

Co-authored-by: Cursor <cursoragent@cursor.com>
@MaximeGaudin
MaximeGaudin merged commit 09b2f86 into main Sep 14, 2026
7 checks passed
MaximeGaudin added a commit that referenced this pull request Sep 14, 2026
- Add DB indexes on (connector, external_id) for conversations and
  messages (migration v14) — avoids full table scans in
  find_by_connector_external_id queries.
- Extract MAX_THREAD_MESSAGES constant in gmail store module.
- Document POST retry trade-off in Slack transport.
- Add Gmail quota source reference in rate limiter constants.

Co-authored-by: Cursor <cursoragent@cursor.com>
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