-
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
Refactor ValidateLogin #10026
Refactor ValidateLogin #10026
Conversation
Not ready for review just yet! |
Still in progress, just need to fill out the tests section and provide screenshots once I get the App test environment working locally. |
…pp into robert-validateLoginRefactor
Should be ready, thanks for the reviews! |
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.
What's going on with the route things, why did we need these changes here?
Race condition as a result of removing chaining (and the convenient delay that an API call adds). See OP for explanation. |
Updated and re-tested, thanks! |
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.
👍 looks good
Let me know if there's anything else and I can address in a followup PR 👍 #urgency #iterate |
@robertjchen looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @robertjchen in version: 1.1.90-0 🚀
|
@flodnv Also, it has to do with the fact that we have two navigation containers – one for PublicScreens and one for AuthScreens. When one unmounts, we have to wait for the other to be ready before we can navigate to routes again. Better long-term design would be to have one parent navigation container, and conditionally render screen groups instead of conditionally rendering navigation containers. |
Thanks for the review! We're refactoring the old
ValidateEmail
call to a newValidateLogin
call that no longer requires chaining behavior. This flow is encountered when an account adds a secondary email and clicks on the resulting email validation link, leading them to verify their account on NewDot.Due to the fact that we no longer chain the subsequent navigation on the result of the API call, we encountered a race condition where we were attempting to navigate before the
NavigationComponent
was full rendered. The solution was to temporarily cache the intended destination and do the redirect after the component had been fully loaded.The corresponding backend API change has gone out already, and can be found here: https://github.com/Expensify/Web-Expensify/pull/34365
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/218822
Tests
Four use cases can occur with this flow:
Resulting Conditions
In the first two cases, the user is simply redirected to their last open report/conversation with no error message displayed. Additionally, in Case 1, the account is silently validated behind the scenes.
In the latter two cases, the user is redirected to the login page. In Case 4, an error message would displayed below the password field stating: "This set password link is invalid or has expired...", while in Case 3, the user would encounter a password prompt.
To test the cases described above:
http://localhost:8080/v/<accountID>/<validationCode>
on local dev (usescript/clitools.sh generator:validateLink
),http://staging.new.expensify.com/v/<accountID>/<validationCode>
on staging, andhttp://staging.new.expensify.com/v/<accountID>/<validationCode>
on production (or, use an email you have access to)PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
The Contributor+ will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)QA Steps
Screenshots
Web
Mobile Web
Desktop
Not applicable, validation link opens browser
iOS
Not applicable, validation link opens browser
Android
Not applicable, validation link opens browser