-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: submitSucceeded is set on redux-form/STOP_SUBMIT #3830
Fix: submitSucceeded is set on redux-form/STOP_SUBMIT #3830
Conversation
When doing a submit the event flow was: redux-form/START_SUBMIT submitting: true redux-form/STOP_SUBMIT submitting: undefined submitSucceeded: true // this should not be here redux-form/SET_SUBMIT_FAILED submitSucceeded: undefined submitFailed: true So on a failed submit we would get a submitSucceeded flag set before we get the submitFailed, which made it very difficult to reliably determine a failure. With this change the submitSucceeded is no longer set with the STOP_SUBMIT action, but only with the dedicated SET_SUBMIT_SUCCEEDED.
👍 just came across this issue myself and this PR would allow reliance on the |
I would also like to see this merged. The current behavior of |
Codecov Report
@@ Coverage Diff @@
## master #3830 +/- ##
========================================
Coverage ? 100%
========================================
Files ? 70
Lines ? 1601
Branches ? 0
========================================
Hits ? 1601
Misses ? 0
Partials ? 0
Continue to review full report at Codecov.
|
Published in |
So, how should we use it from now on if we need |
@8of you shouldn't need to call any of redux-form's action creators or to do anything special. redux-form passes a prop called Unless I'm misunderstanding your question...? |
@cdimitroulas |
hmm that's odd - shouldn't be the case. @stefan-dimitrov should the reducer also set @8of for now as a workaround you could maybe check that |
I believe it should not. My understanding is that those actions should set only their respective flags, without affecting others, even if they are "thematically" related (submit completion and submit success). I could be wrong, but what you are describing, @8of, seems to be manual setting of the flags, without relying on the mechanisms in |
The only downside I can think of - Thank you guys for the clarification. 👏 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
When doing a submit the event flow was:
So on a failed submit we would get a submitSucceeded flag set before we get the submitFailed, which made it very difficult to reliably determine a failure.
With this change the submitSucceeded is no longer set with the STOP_SUBMIT action, but only with the dedicated SET_SUBMIT_SUCCEEDED.
Fixes #2260