Skip to content

fix(googledrive): paginate changes.list in driveChanged webhook #588

Description

@ambikeesshh

packages/googledrive/webhooks/changes.ts fetches the changes feed once with pageSize: 100 and never follows nextPageToken.

ChangeList already has nextPageToken / newStartPageToken. Neither is used on the webhook path.

If more than one page of changes is pending, later events are dropped. Worse with the recent-changes filter: page 1 can look "old", get filtered empty, and fresh changes on later pages never load.

Fix

Loop changes.list while nextPageToken is present (cap pages if needed). Optionally persist newStartPageToken for the next watch cycle.

Check

  • multi-page change feeds are fully consumed
  • recent-change filtering still works across pages
  • unit test with a mocked multi-page response
pnpm --filter @corsair-dev/googledrive test

Metadata

Metadata

Labels

bugSomething isn't workingdifficulty: mediumClear scope but needs more carepluginChanges inside a plugin package

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions