Skip to content

Commit

Permalink
Merge pull request #1212 from elie222/fix/gmail-history-pagination-ob…
Browse files Browse the repository at this point in the history
…servability
  • Loading branch information
Elie Steinbock authored and GitHub committed Jan 6, 2026
2 parents 06413c6 + 77fd865 commit d8a8352
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/web/app/api/google/webhook/process-history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,14 @@ async function fetchGmailHistoryResilient({
historyTypes: ["messageAdded", "labelAdded", "labelRemoved"],
maxResults: 500,
});

if (data.nextPageToken) {
logger.warn("Gmail history has more pages that were not fetched", {
historyItemCount: data.history?.length ?? 0,
startHistoryId,
});
}

return { status: "success", data, startHistoryId };
} catch (error) {
// Gmail history IDs are typically valid for ~1 week. If older, Gmail returns a 404.
Expand Down

0 comments on commit d8a8352

Please sign in to comment.