Repository navigation
Conversation
There was a problem hiding this comment.
🤖 AI Review
The PR correctly prevents transport-error retries for non-idempotent HTTP methods. The alleged major response-retry bug is refuted because isRetryableResponse already checks method idempotency. The remaining confirmed findings are a minor resilience tradeoff and two test/readability nits; no major correctness issue remains.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | packages/api/src/internal/client.ts:226 |
reliability |
claude | The method-only transport retry gate cannot preserve retries for pre-dispatch failures or POST operations with an explicit idempotency guarantee, reducing resilience even where replay could be safe. |
| ⚪ NIT | packages/api/src/internal/client.ts:226 |
readability |
claude | The request-method idempotency check is loop-invariant but is recomputed for every retry attempt. |
| ⚪ NIT | packages/api/src/internal/client.unit.test.ts:689 |
test-coverage |
claude | Transport retry behavior is covered for POST but not PATCH; the new mock's 409 fallback is exercised only if an unintended retry occurs. |
Refuted findings (kept for transparency, not posted as review comments)
packages/api/src/internal/client.ts:231(retry-safety): Non-idempotent requests can still be retried after a retryable HTTP response, risking duplicate side effects.
Refuted: Concrete counter-evidence appears at packages/api/src/internal/client.ts:195-198:isRetryableResponsereturns true for 5xx responses only whenisIdempotentMethod(response.request.method)is also true. Therefore POST and PATCH responses cannot enter the retry branch.
Stats
Claude findings: 3 · Codex findings: 1 · Confirmed: 3 · Refuted: 1 · Uncertain: 0
Models: claude-opus-5 + gpt-5.6-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
jgoux
left a comment
There was a problem hiding this comment.
Cross-review completed with an independent reviewer; consensus is that there are no actionable defects introduced by this PR. The transport-error gate also covers converted request timeouts, applies to the executeRaw path used by projects create, and preserves the existing idempotent-method and 5xx retry behavior.
Verified locally at this commit: all 94 API unit tests passed, and the API type check passed. No inline findings to report.
TL;DR
stops
projects createresending a POST after a dropped connection, which surfaced "already exists" for a project the server had just created.whats broken?
transport errors (a connection reset or the 60s timeout) were retried for any method
while the 5xx retry was already gated on idempotency
when the server had already accepted the first
projects createPOST, the resend hit 409 and the new ref was never printednow fixed by:
gating transport error retries in the
@supabase/apiclient on the same idempotency check as the 5xx path,so GET, PUT, DELETE and HEAD still retry while POST and PATCH thru the client are sent once...
ref:
projects createfails misleadingly on flaky networks #6699