Regression: onSubmit can be invoked concurrently while a submission is in progress (v1.33.1)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.7k
- Forks
- 682
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 7
Description
Describe the bug
After upgrading to v1.33.1, it appears that onSubmit can be invoked multiple times while a previous submission is still pending.
In previous versions, clicking the submit button while a submission was already in progress would not invoke onSubmit again. After upgrading, each click results in another invocation of onSubmit, causing multiple concurrent submissions.
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/nostalgic-brook-w68c8p
Steps to reproduce
- Click Submit.
- Before the 2-second onSubmit promise resolves, click Submit several more times.
Expected behavior
While a submission is in progress, subsequent clicks should not invoke onSubmit again. Only a single submission should be active at a time.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- OS: Windows
- Browser: Firefox
- Version: 154.0b7
TanStack Form adapter
react-form
TanStack Form version
1.33.1
TypeScript version
v6.0.3
Additional context
I believe this regression was introduced by #2120
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodeSandbox and reproduce the issue by clicking Submit repeatedly before the 2-second promise resolves. Trace the react-form submission handling related to the v1.33.1 regression and verify that repeated clicks during a pending submission invoke onSubmit only once.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100