Refactor ChangePassword#9218
Conversation
|
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 😄 |
mountiny
left a comment
There was a problem hiding this comment.
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.
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. |
mountiny
left a comment
There was a problem hiding this comment.
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 |
marcaaron
left a comment
There was a problem hiding this comment.
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. |
techievivek
left a comment
There was a problem hiding this comment.
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 Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)PR Reviewer Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesSTYLE.md) were followed/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris 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