feat: add precondition required response code#6954
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@y-nk is attempting to deploy a commit to the trpc Team on Vercel. A member of the Team first needs to authorize it. |
|
Also I think this should be updated in some doc |
|
@KATT while i'm at it, would you want me to add the rest of the missing http codes? |
WalkthroughAdds a new TRPC error key PRECONDITION_REQUIRED (code -32028) and maps it to HTTP status 428 across server mappings and documentation. No API signatures or runtime control flow were changed. Changes
Sequence Diagram(s)Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
Comment |
@trpc/client
@trpc/next
@trpc/react-query
@trpc/server
@trpc/tanstack-react-query
@trpc/upgrade
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
www/docs/further/rpc.md(2 hunks)www/docs/server/error-handling.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,md,mdx}
📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)
Use camelCase for file names (with exceptions like TRPC/RPC/HTTP/JSON acronyms, .config.js, .d.ts, and tests)
Files:
www/docs/server/error-handling.mdwww/docs/further/rpc.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: test
- GitHub Check: build
- GitHub Check: typecheck
- GitHub Check: Lint and auto-fix
🔇 Additional comments (2)
www/docs/further/rpc.md (2)
207-207: Mapping looks correct: PRECONDITION_REQUIRED → 428.This aligns with HTTP 428 and complements TOO_MANY_REQUESTS (429).
258-258: JSON-RPC mapping looks correct: PRECONDITION_REQUIRED → -32028.Consistent with the “copy last digits of HTTP 4XX” convention.
There was a problem hiding this comment.
Actionable comments posted: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
www/docs/server/error-handling.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,md,mdx}
📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)
Use camelCase for file names (with exceptions like TRPC/RPC/HTTP/JSON acronyms, .config.js, .d.ts, and tests)
Files:
www/docs/server/error-handling.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: E2E-tests (.test/ssg)
- GitHub Check: e2e-legacy-node (next-prisma-todomvc, 20.x)
- GitHub Check: E2E-tests (.test/internal-types-export)
- GitHub Check: E2E-tests (soa)
- GitHub Check: E2E-tests (next-prisma-todomvc)
- GitHub Check: E2E-tests (next-prisma-starter)
- GitHub Check: E2E-tests (express-server)
- GitHub Check: E2E-tests (.test/diagnostics-big-router)
- GitHub Check: e2e-legacy-node (next-prisma-todomvc, 18.x)
- GitHub Check: e2e-legacy-node (next-prisma-websockets-starter, 18.x)
- GitHub Check: e2e-legacy-node (next-prisma-websockets-starter, 20.x)
- GitHub Check: e2e-legacy-node (next-prisma-starter, 20.x)
- GitHub Check: e2e-legacy-node (next-prisma-starter, 18.x)
- GitHub Check: Test a monorepo using built declaration files
- GitHub Check: E2E-tests (Deno) (deno-deploy)
- GitHub Check: Release using pkg.pr.new
- GitHub Check: E2E-tests (Bun) (bun, ubuntu-latest)
- GitHub Check: typecheck-www
- GitHub Check: test
- GitHub Check: Lint and auto-fix
🔇 Additional comments (1)
www/docs/server/error-handling.md (1)
41-41: Verify naming: METHOD_NOT_SUPPORTED vs METHOD_NOT_ALLOWEDDocs show METHOD_NOT_SUPPORTED (www/docs/server/error-handling.md:41). Confirm the codebase's TRPC error-key for HTTP 405 (TRPC_ERROR_CODES_BY_KEY and any reverse mappings) and make docs or constants consistent.
Run locally:
- rg -n -S '\bMETHOD_NOT_SUPPORTED\b|\bMETHOD_NOT_ALLOWED\b'
- rg -n -S 'TRPC_ERROR_CODES_BY_KEY' and inspect which key maps to 405
|
This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you. |
Closes #
🎯 Changes
What changes are made in this PR? Is it a feature or a bug fix?
#6885
adds missing 428 http error which i require.
✅ Checklist
Summary by CodeRabbit
New Features
Documentation