Uh oh!
There was an error while loading. Please reload this page.
Google: stop the Tasks poll erroring on a disconnected account - #357
Merged
Conversation
Google Tasks has no webhooks, so its sync is a durable hourly poll. When the account's OAuth grant lapses or is revoked, the channel resolves no token and the poll threw an unhandled error — once an hour, multiplied by the queue's retries, for as long as the connection stayed disconnected. That state is expected and already surfaced: resolving no token flags the connection for re-auth, so the app shows "Reconnect" and only the user can clear it. It's also specific to Tasks among this connector's products — mail and calendar are push-driven, and a revoked grant simply stops delivering notifications, so nothing keeps knocking. The poll now ends the cycle quietly instead. It drops the in-flight cycle state and reports done; the recurring schedule re-fires on its own and picks back up once the connection is restored. `last_sync_time_` is left untouched, so the window skipped while disconnected is re-covered by the first successful cycle rather than being silently lost, and the channel is left enabled — this is not a teardown, unlike the deleted-task-list path. The initial backfill deliberately keeps throwing: the app shows a sync spinner until the backfill reports completion, and a silent early return there would leave it spinning forever. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Symptom
Google Tasks has no webhooks, so its sync is a durable hourly poll. When the account's OAuth grant lapses or is revoked, the channel resolves no token and the poll threw an unhandled error — once an hour, multiplied by the queue's retries, for as long as the connection stayed disconnected.
That state is expected and already surfaced: resolving no token flags the connection for re-auth, so the app shows Reconnect and only the user can clear it. It's also specific to Tasks among this connector's products — mail and calendar are push-driven, and a revoked grant simply stops delivering notifications, so nothing keeps knocking.
Fix
periodicSyncBatchFnnow fetches the token through a new non-throwingtryGetTokenFn(mirroring the mail module's existingtryGetApiFn) and ends the cycle quietly when there is none:done, so the recurring schedule re-fires on its own and picks back up once the connection is restored;last_sync_time_untouched, so the window skipped while disconnected is re-covered by the first successful cycle rather than silently lost;The initial backfill deliberately keeps using the throwing
getTokenFn: the app shows a sync spinner until the backfill reports completion, so a silent early return there would leave it spinning forever.Tests
Two cases added to
src/tasks/sync.test.ts, both driven from a host whoseintegrations.getresolvesnull:{ done: true }, clears only the cycle state, and does not cancel the schedule, archive links, disable the channel, advancelast_sync_time_, or call the API;Full connector suite: 369 passing.