Repository navigation
Conversation
Add resilient retry logic with exponential backoff and Retry-After header parsing for idempotent GET requests in GoogleClient. Retries apply up to MAX_READ_RETRIES (2) on HTTP 429, HTTP 503, and transient network errors. Write operations (POST, PATCH, DELETE) remain strictly single-attempt without retrying to guarantee mutation safety.
|
The read/write split here looks good. I think the retryable-read predicate may be a little too narrow, though. Right now idempotent GETs retry only Would it be cleaner to encode that as one explicit read-only retry predicate rather than special-casing For example, an explicit set such as That keeps the important invariant simple: retry eligibility is determined by operation safety first, then transient response classification. AI-use note: I used an AI assistant to help inspect the retry boundary and draft this review; I verified the cited behavior against the current PR diff and existing Google write-safety tests before posting. |
…, 502, 504 Address review feedback by defining an explicit retryable-read status predicate (429, 500, 502, 503, 504). Write operations remain non-retryable and fail fast with OutcomeUnknownError on 5xx.
|
Thanks for the thoughtful review and suggestion, @kvnloo! I've pushed commit \42755f5\ addressing this feedback:
|
|
Needs changes before merge:
Refs: https://developers.google.com/workspace/gmail/api/guides/handle-errors and https://developers.google.com/workspace/calendar/api/guides/errors |
jerelvelarde
left a comment
There was a problem hiding this comment.
Value: bounded retries improve Google read reliability. Template/security: read retries remain bounded and writes retain single-attempt OutcomeUnknownError semantics; 33 Google tests passed, no actionable security defect found. Please integrate current main before approval: packages/integrations/src/google.ts and tests/google.test.ts conflict with the merged charset, filename, calendar-zone and calendar-range fixes. Preserve those behaviors and rerun combined regressions. Also update the description's retry-status list to include the implemented 500/502/504 statuses.
|
Updated in
Verification: |
What changed
Retry-Afterheader parsing for idempotentGETread requests inGoogleClient.MAX_READ_RETRIES = 2(up to 3 total attempts) on HTTP 429, 500, 502, 503, 504, Google 403rateLimitExceeded/userRateLimitExceeded, and transient network failures.Retry-Afterstill wins when Google sends it, capped at 30 seconds.POST,PATCH,DELETE) are never retried and immediately throwOutcomeUnknownErroron uncertain network or server errors.mainand preserved the newer charset, attachment filename, calendar zone, and calendar range fixes.Verification
git diff --checknode --import tsx/esm --test tests/google.test.ts(46 passed)