feat(trigger): add Google Sheets, Drive, and Calendar polling triggers#4081
feat(trigger): add Google Sheets, Drive, and Calendar polling triggers#4081waleedlatif1 merged 19 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Updates block configs for Google Calendar/Drive/Sheets to expose these triggers in the UI by spreading trigger Introduces a new sub-block mode Reviewed by Cursor Bugbot for commit 9a33570. Configure here. |
Greptile SummaryThis PR adds polling triggers for Google Sheets (new rows), Google Drive (file changes), and Google Calendar (event updates), wires them into the existing block configs, introduces a new Confidence Score: 5/5Safe to merge — all previously flagged P0/P1 concerns have been addressed; remaining findings are P2 style/quality suggestions only. The cursor-revert-on-failure logic, timestamp guard for Calendar, rate-limit handling, and idempotency with apps/sim/lib/webhooks/polling/google-drive.ts (rate-limit error messaging) and apps/sim/lib/webhooks/polling/google-calendar.ts (empty-poll timestamp update). Important Files Changed
Sequence DiagramsequenceDiagram
participant Scheduler as Trigger.dev Scheduler
participant Poller as Polling Handler<br/>(Calendar / Drive / Sheets)
participant GoogleAPI as Google API
participant Idempotency as IdempotencyService<br/>(retryFailures=true)
participant Processor as processPolledWebhookEvent
participant DB as Webhook Config (DB)
Scheduler->>Poller: pollWebhook(ctx)
Poller->>DB: read providerConfig (cursor / timestamp / rowCount)
alt First poll (no state)
Poller->>GoogleAPI: getStartPageToken / now.toISOString()
Poller->>DB: seed initial state
Poller-->>Scheduler: success (no events fired)
else Subsequent poll
Poller->>GoogleAPI: fetch changes since cursor/timestamp
GoogleAPI-->>Poller: events / changes / rows
alt No results
Poller->>DB: update state (Sheets/Drive) or keep timestamp (Calendar)
Poller-->>Scheduler: success
else Results found
loop for each event/change/row
Poller->>Idempotency: executeWithIdempotency(key, operation)
alt Cache hit (completed)
Idempotency-->>Poller: cached result (no re-fire)
else Cache hit (failed) + retryFailures=true
Idempotency->>DB: delete failed key
Idempotency->>Processor: re-execute operation
else First time
Idempotency->>Processor: execute operation
Processor-->>Idempotency: success / failure
end
end
alt Any failures
Poller->>DB: revert cursor/timestamp/rowCount
else All success
Poller->>DB: advance cursor/timestamp/rowCount
end
Poller-->>Scheduler: success or failure
end
end
Reviews (11): Last reviewed commit: "fix(polling): advance calendar cursor pa..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
3d6edeb to
e14ff04
Compare
|
@greptile |
|
@cursor review |
|
@greptile |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
… past filtered events
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 9a33570. Configure here.
Summary
changes.listAPI with opaque cursor (no clock skew, catches deletes)updatedMin+singleEvents=true(expanded recurring events)modifiedTimepre-check (saves Sheets quota)generate-docs.tsdiscovers themintegrations.jsonwith new trigger entriesadd-triggerskill with polling instructions and versioned block wiring guidancetrigger-advancedmode for subblocks for advanced mode fields in trigger modeType of Change
Testing
Tested manually — type-check passes, lint passes,
integrations.jsonregenerated correctlyChecklist