-
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 ChangePassword #9218
Refactor ChangePassword #9218
Conversation
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 so far. Is there anything else remaining to be updated with this other than updating the PR checklist and adding tests and videos/screenshots?
PR is ready for review, should be reviewed and tested alongside: https://github.com/Expensify/Web-Expensify/pull/33885 pulling in @iwiznia since you said you had time for refactor 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.
Came over out of curiosity, LGTM. It would great to leave a video of the testing steps succeeding with the Web-E branch.
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.
Changes seem to work fine. Can we add a video testing this new refactor?
Also While testing this, I observed something interesting(not sure if it is a bug) but once I changed the password (and got a confirmation) I clicked on the back arrow and tried changing the password again and it shows Session expired error
and this is nowhere visible on the UI just in the response data and spinner is in running state. But I didn't have to log in again I refreshed the page and everything worked fine.
update branch
Refactored to use the new command. Here is the video: Screen.Recording.2022-06-08.at.11.43.06.AM.mov
Hmmm, that's interesting, although I don't think it's related to this PR. |
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.
Also While testing this, I observed something interesting(not sure if it is a bug) but once I changed the password (and got a confirmation) I clicked on the back arrow and tried changing the password again and it shows Session expired error and this is nowhere visible on the UI just in the response data and spinner is in running state. But I didn't have to log in again I refreshed the page and everything worked fine.
@techievivek would you be able to see if the same reproduction steps do this on the main too or it does not happen on main branch? To be sure it is related to this PR
@madmax330 @vitHoracek I tested this on main, and the problem doesn't seem to appear, but when I tried on this PR along with Web-E PR, it seemed to happen. Not sure why that is happening. video-9358611-01ca603449236312953df336d8a9c4e3.mp4 |
Hmm the only explanation I can think of is b/c we're using API.write() instead of the deprecated API. |
Either way, I'm waiting on the web PR to be complete then I'll test this again and try to figure it out. |
update branch
Ok so testing this, I think I found an interesting bug that might affect a few commands on the refactor. Here is the video: Screen.Recording.2022-06-16.at.6.03.44.PM.movBasically when I try to change the password after having changed it successfully, I get stuck in an infinite loop making requests to the API. I think this is because the command uses Since it's in the sequentialQueue, it's not removed and is tried again and again. cc @marcaaron am I missing something? Did we already discuss how we should handle this? |
One idea is to just force all requests in the write queue to have a Lines 38 to 39 in 07fabcf
Looks like these params are no longer included, but the reauthentication middleware still looks at them. |
Alright, updated and retested, everything should be fine now |
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.
When testing I am seeing multiple API calls and calls to UpdatePassword
and a call to Authenticate
(even though the authToken is up to date). I might need to update Auth or something though or maybe it is expected that a successful call to UpdatePassword
returns this response? Unsure...
Same as @techievivek 2022-06-20_09-54-16.mp4 |
Yeah @marcaaron what you posted is the expected behavior. |
Yep, that is expected behaviour. |
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 to me now. Thanks
Ok I was confused but I think what happens is....
|
Linked Web-E PR is on production so gonna merge this one 🚀 |
@marcaaron looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
No emergency everything was pass |
✋ 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 @marcaaron in version: 1.1.79-0 🚀
|
🚀 Deployed to production by @roryabraham in version: 1.1.79-17 🚀
|
Details
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/211242
Tests
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
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followed/** 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
Enter the correct password and a new password and everything should work.
Verify that no errors appear in the JS console
Screenshots
Web
Mobile Web
Desktop
iOS
Android