Stop double-submit of set password form#9445
Conversation
| password={this.state.password} | ||
| updatePassword={password => this.setState({password})} | ||
| updateIsFormValid={isValid => this.setState({isFormValid: isValid})} | ||
| onSubmitEditing={this.validateAndSubmitForm} |
There was a problem hiding this comment.
Heads up looks like this is a required prop and will be called here
App/src/pages/settings/NewPasswordForm.js
Line 23 in fb3b4ac
App/src/pages/settings/NewPasswordForm.js
Line 79 in 639a559
https://reactnative.dev/docs/textinput#onsubmitediting (had to look this up wasn't quite sure what it was for)
There was a problem hiding this comment.
Ah, good to know. I'll put a no-op instead then.
|
Updated |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
@tgolen I just noticed that this PR included changes on the |
|
🚀 Deployed to staging by @aldo-expensify in version: 1.1.78-0 🚀
|
|
@aldo-expensify ah, phooey. That wasn't intended to get through. I'm sure it's fine (for the sake of production and for NPM packages), but I'm not sure what havok this will cause to other devs. Once we are all on M1s it will probably self-resolve. I think it's OK to lave as-is for now though. |
|
🚀 Deployed to production by @sketchydroide in version: 1.1.78-8 🚀
|
Details
When pressing enter, the form was being submit twice. Once for the text input and one for the submit button. The multiple submits was causing
validateAndSubmitForm()to be ran multiple times, and the second time it ran, it would havethis.props.userSignUp.authTokenfrom the first request. This causedchangePasswordAndSignIn()to be triggered from an invalid state and put the UI into a position where it couldn't fetch all the reports. Since the reports couldn't fully load, it was stuck at a loading spinner.Fixed Issues
$ #9058
Tests
For local tests, you'll need to be able to get the validate code for a new account.
../script/sql.shSELECT FROM notifications ORDER BY created DESC LIMIT 0,1;accountIDandvalidateCodehttp://localhost:8080/setpassword/<accountID>/<validateCode>(use the values from the query)QA Steps
Screenshots
This but only effects web because that is the only way to validate an account.
Web
2022-06-14_09-53-11.mp4
2022-06-14_09-37-19.mp4
Mobile Web
Desktop
iOS
Android