-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Stop double-submit of set password form #9445
Conversation
@@ -126,7 +126,6 @@ class SetPasswordPage extends Component { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads up looks like this is a required prop and will be called here
App/src/pages/settings/NewPasswordForm.js
Line 23 in fb3b4ac
onSubmitEditing: PropTypes.func.isRequired, |
App/src/pages/settings/NewPasswordForm.js
Line 79 in 639a559
onSubmitEditing={() => this.props.onSubmitEditing()} |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.authToken
from 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.sh
SELECT FROM notifications ORDER BY created DESC LIMIT 0,1;
accountID
andvalidateCode
http://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