Repository navigation
fix(server): pass the submitted input to onError in nextAppDirCaller - #8051
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@LittleChenLiya is attempting to deploy a commit to the trpc Team on Vercel. A member of the Team first needs to authorize it. |
@trpc/client
@trpc/next
@trpc/openapi
@trpc/react-query
@trpc/server
@trpc/tanstack-react-query
@trpc/upgrade
commit: |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
trpc-bot
left a comment
There was a problem hiding this comment.
Checked locally: both new onError tests fail with the source change reverted ({ name: 'stale' } and raw FormData) and pass with it. CI green.
Generated by Claude Code
|
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. |
Why
useActionState, an action's first argument is the previous state, andnextAppDirCallerpassed that toonErrorinstead of the submitted input.What
onErrorgets theinputthe procedure received, in both the mutation and query branches.FormDataargument now reachesonErroras the normalized object, the same value the procedure got. Before, it got the rawFormData.Links
Alternatives considered
opts.args[0]: still wrong foruseActionState.Testing
onErrortests inpackages/server/src/adapters/next-app-dir.test.tsfail without the fix (they get{ name: 'stale' }and a rawFormData).AI model