Repository navigation
refactor(client)!: unify retry and attempt option naming - #2525
Conversation
"retries" now always means additional tries after the first, and "attempts" always means total tries and is always plural. - RetryLinkPlugin: context `retry` renamed to `maxRetries` - RetryAfterLinkPlugin: `condition` renamed to `shouldRetry`, and `maxAttempts` (total, default 3) replaced by `maxRetries` (excluding the first request, default 2) - WebSocket reconnect: `maxAttempt`, `maxTotalAttempt` and `totalAttempt` renamed to `maxAttempts`, `maxTotalAttempts` and `totalAttempts`
Restore the v1 name instead of `maxRetries` to avoid a breaking change; its JSDoc and docs still state that it excludes the first call.
Restore the v1 name and total-attempts counting instead of `maxRetries`; its JSDoc and docs state that the first request is counted.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
orpc | 1a07bac | Commit Preview URL Branch Preview URL |
Nov 21 2026, 09:55 AM |
More templates
@orpc/ai-sdk
@orpc/arktype
@orpc/bun
@orpc/client
@orpc/cloudflare
@orpc/contract
@orpc/effect
@orpc/evlog
@orpc/hibernation
@orpc/json-schema
@orpc/experimental-lock
@orpc/mcp
@orpc/msw
@orpc/nest
@orpc/next
@orpc/node
@orpc/openapi
@orpc/experimental-openapi-inference
@orpc/opentelemetry
@orpc/pinia-colada
@orpc/pino
@orpc/publisher
@orpc/ratelimit
@orpc/server
@orpc/shared
@orpc/swr
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/zod
commit: |
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound — the rename is purely vocabulary alignment on a pre-2.0 public surface, and every documented counting rule was checked against the implementation.
Reviewed changes
RetryAfterLinkPluginrename —condition→shouldRetryis complete (option, private field, call site, tests, both docs pages, migration guide); no other repo consumers passedcondition.maxAttemptssemantics documented — the new JSDoc claim (3= 2 retries,1= no retries) matchesattemptCount++followed byattemptCount >= maxAttempts.- WebSocket reconnect renames —
maxAttempts/maxTotalAttempts/totalAttemptsare propagated through the interface, constructor, info object, tests andadapters/websocket.mdx; no stale singular names remain in the repo, and the adapter is new in v2, so no migration entry is needed. RetryLinkPluginJSDoc —attemptas attempts made so far (first call included) andretry: 3→ up to 4 total attempts both hold for the plain and streamed (callNext({ error })) paths.- Migration guide — the new Retry After section correctly keeps the v1 class name
RetryAfterPluginin the v1 snippet; v1 did shipcondition+maxAttempts, so the entry is accurate.
Local vitest run on retry-after.test.ts, retry.test.ts and adapters/websocket/rpc-link.test.ts passes (76 tests).
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance1 warning
Comparing Footnotes
|

Summary
Retry and attempt options in
@orpc/clientwere spelled and counted inconsistently. This aligns them on one vocabulary before stable 2.0:Changes
RetryAfterLinkPlugin(breaking):conditionis renamed toshouldRetry, matchingRetryLinkPlugin.maxAttemptskeeps its name, default (3) and meaning; its JSDoc now says the first request is counted.maxAttempt,maxTotalAttemptand the info fieldtotalAttemptare renamed tomaxAttempts,maxTotalAttemptsandtotalAttempts.attempt(the current attempt number) stays singular.RetryLinkPlugin: no API change. The JSDoc forretryand for the callback'sattemptnow state how they count (retry: 3allows up to 4 attempts in total).plugins/retry.mdx,plugins/retry-after.mdxandadapters/websocket.mdxupdated; the v1 migration guide gains acondition→shouldRetryentry.Notes for reviewers
retryandmaxAttemptswere deliberately kept as in v1 to avoid breaking existing users; only their documentation changed.reconnectMaxAttempt,totalAttempt) are left as-is to avoid conflicts with other in-flight changes to that file.pnpm checkand the client plugin, WebSocket adapter and retry e2e tests pass.