fix(sync): drop durable calendar-list discovery failures - #2689
Closed
cursor[bot] wants to merge 1 commit into
Closed
fix(sync): drop durable calendar-list discovery failures#2689cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Classify Google calendarList 4xx refusals as discoveryFailed and settle them as drops instead of retryableTransient, matching the readFailed path. Keeps 429/5xx/network and rate-limit 403s as transient retries. Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
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
Stops Google calendar-list durable 4xx refusals (e.g. "The user must be signed up for Google Calendar.") from burning the sync retry ladder and tripping self-heal alarms.
PostHog cluster (7d):
calendarListSyncon connection6a653974…with root causeProviderCalendarError(discoveryFailed): … The user must be signed up for Google Calendar.6a76454e…subscriptionMaintain/watchFailedhalf of the same fingerprint already fixed by fix(sync): settle durable google watch failures instead of retrying #2635Root cause:
google-calendar.adaptermapped every non-410 list failure todiscoveryFailed, andsyncCalendarList/ dispatch treated that as transient →retryableTransient× 20 →failed→ self-heal requeue loop.Fix (mirrors event
readFailed/ watchwatchFailed):cursorExpired(410),transient(429/5xx/network + rate-limit 403 reasons),discoveryFailed(durable 4xx)dispatchSyncJobdrops durablediscoveryFailed, stampslastReadFailure*on the calendarList resource, frees the coalescing key for later rediscovery/reconnectSimplicity
Minimal path parallel to existing
readFailedsettlement — no new job failure class, no health-model redesign. Classification helpers stay local to the Google calendar adapter (same shape as event-reader / notifications).Automated validation
bun test:sync -- packages/sync/src/providers/google/google-calendar.adapter.test.ts packages/sync/src/domain/sync-job-dispatch.service.db.test.ts packages/sync/src/domain/calendar-list-sync.service.db.test.ts→ 48 passbun run lint→ no new issues (existing repo warnings only)Independent review
Self-reviewed against the prod log cause chain and the settled
readFailed/watchFailedpatterns. Confirmed rate-limit 403s remain transient.Test plan
bun test:sync -- packages/sync/src/providers/google/google-calendar.adapter.test.ts packages/sync/src/domain/sync-job-dispatch.service.db.test.ts packages/sync/src/domain/calendar-list-sync.service.db.test.tsbun run lintRemaining risk / follow-up
6a76454e6a9f4b8649b55e41(calendarListSync:6a6539741eaf145653f64365) so rediscovery can re-enqueue; self-heal budget is already exhausted for that row.GenericError.NotSure(“Not sure why error occurred. See logs”, 60 occ) from calendar list proxy remains opaque in PostHog becauseerror()puts the useful kind onresult, notError.message— separate triage improvement, not required for this storm.019fd9ff-…/019fdc65-…once volume stops post-deploy.