fix(sidecar): resume Gmail history past page cap when pages are deduped - #691
Closed
cursor[bot] wants to merge 2 commits into
Closed
cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
…ed (#667) When Gmail history spans more than MAX_HISTORY_PAGES (3) and pages 1–3 are fully deduped, truncated=true froze the cursor forever and page 4+ messages were never ingested — silent data loss during mail bursts. Persist history_page_token in sidecar_state (migration 32) and pass it to listNewMessageIds so the next poll resumes from the dangling pageToken instead of re-fetching already-deduped pages. Co-authored-by: schmug <schmug@users.noreply.github.com>
…nit test Complements #667 cherry-pick: first truncated-history poll test now checks the persisted page token, and gmail-client gets a resumePageToken test. Co-authored-by: schmug <schmug@users.noreply.github.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ais-hub | afb1d84 | Commit Preview URL Branch Preview URL |
Aug 22 2026, 11:10 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
agentic-inbox | afb1d84 | Aug 22 2026, 11:12 AM |
Owner
5 tasks
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
history_page_tokeninsidecar_state(migration 32) when Gmail history listing is truncated by the 3-page caplistNewMessageIdsfrom the danglingpageTokenon the next poll instead of re-fetching already-deduped pagesWhy
When Gmail history spans more than
MAX_HISTORY_PAGES(3) and pages 1–3 contain only already-ingested messages (all deduped),truncated=truefreezes the cursor forever. The poller re-fetches the same 3 pages every minute and never reaches page 4+, causing silent mail loss for sidecar mailboxes during bursts.Test plan
npm testpasses locally (60 tests: workspace-poll, gmail-client, sidecar-state)listNewMessageIdsresumes fromresumePageTokeninstead of re-fetching first pageshistory_page_tokenis persistedNotes for reviewer
Cherry-pick of validated fix from
cursor/critical-bug-investigation-1317(#667). Same fix has been identified in prior automation runs but not yet merged to main.