-
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
Add ResendResetPassword action to break up ResetPassword #10798
Conversation
src/libs/actions/Session/index.js
Outdated
key: ONYXKEYS.ACCOUNT, | ||
value: { | ||
isLoading: false, | ||
message: null, |
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.
NAB I'm wondering if we actually need to set message: null
here. We already clear message
in optimisticData
so it should already be empty. This applies for failureData
and for resendResetPassword
too.
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.
Yeah my only thought was if something else would have set this message
key previously?
Though I just tested this and don't think it's possible, here's what I did
- sign up with a new account, click resend to resend a 2nd validation link and get the success message which also uses
account.message
. - validate the account outside of going through new dot (I simulated this with cli tools to validate for me)
- go back to "start" page and enter email again and then click
forgot?
. Here is where I was expecting themessage
previous to persist but it didn't so I think we're okay. There is probably a corner case somewhere lurking if we don't probably clear outaccount.message
but we can fix that if it ever shows up easily.
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.
Whenever we tap Forgot?
we trigger resetPassword and we clear message
and error
in optimisticData, so I think that we should be ok.
src/libs/actions/Session/index.js
Outdated
onyxMethod: CONST.ONYX.METHOD.MERGE, | ||
key: ONYXKEYS.ACCOUNT, | ||
value: { | ||
isLoading: true, |
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.
NAB maybe this is just me, but it looks a bit odd to be redirected to the Forgot page and see the loading indicator when the message above says we sent a link already. Should we just remove the loading indicator from the first load? 🤔
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.
Yep agreed.
…o set it in success/failure data
Updated and ready for review. Though there is one thing I'm not sure about, we didn't want the Brick Road messaging showing up when the page first loaded but in the case for SAML required users it actually is and I think that's okay since it then gives a heads up that we didn't actually send the email. |
I think the SAML case makes sense. |
src/libs/actions/Session/index.js
Outdated
successData: [ | ||
{ | ||
onyxMethod: CONST.ONYX.METHOD.MERGE, | ||
key: ONYXKEYS.ACCOUNT, | ||
value: { | ||
isLoading: false, | ||
}, | ||
}, | ||
], | ||
failureData: [ | ||
{ | ||
onyxMethod: CONST.ONYX.METHOD.MERGE, | ||
key: ONYXKEYS.ACCOUNT, | ||
value: { | ||
isLoading: false, | ||
}, | ||
}, | ||
], |
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.
Hmm now that we don't set isLoading
in optimisticData, there's no need to set it to false here. So we can just get rid of both successData
and failureData
The code changes look fine but the test didn't work for me. Also I don't have access to a SAML account. @bondydaa @luacmartins Do I need any additional setup here? I am getting 404 errors in the network tab on clicking Resend Link requestresendpassword.mp4 |
@mananjadhav the API changes that introduce this command are only in staging at the moment. You can either wait until these changes make it to prod (probably on Monday) or point your App to the staging API to test. |
@luacmartins I thought so, I copied |
@mananjadhav web might be a problem, but I don't have issues on desktop or mobile. Maybe you can test those? |
Yeah App and Desktop I'll sort out. Then I'll test on these platforms and Monday if it is pushed I'll test the Web too. |
Changes look good and I tested them on Desktop, iOS and Android App. The only corner case that might not be related to the PR is, if I press 🎀 👀 🎀 I haven't tested on Web and mWeb.
|
@mananjadhav thanks for the review! I think that edge case exists for all commands that set a loading state, so I wouldn't block this PR on that. That being said, we should probably address the general issue since it could happen quite often with spotty connections. |
Web-E PR is in prod. Removing hold and merging! |
I edited the checklists so that tests pass. |
@luacmartins looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
Tests passed. Removed |
✋ 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 @luacmartins in version: 1.2.3-0 🚀
|
🚀 Deployed to production by @luacmartins in version: 1.2.3-1 🚀
|
Details
We were re-using an api action in two different places when we wanted different behavior so this splits them so that we can do different things when
Forgot?
is clicked vsResend Link
is clicked.Fixed Issues
$ #10785
Tests
Non SAML account test
Forgot?
button when prompted for you password.Resend link
button and ensure the success Brick Road message showsSAML account test
Forgot?
button when prompted for you password ensure the next page doesn't show a loader or any Brick Road messagesPR 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
Non SAML account test
Forgot?
button when prompted for you password.Resend link
button and ensure the success Brick Road message showsSAML account test
Forgot?
button when prompted for you password ensure the next page doesn't show a loader or any Brick Road messagesScreenshots
Web
Mobile Web
Desktop
No message or loader shows when you first click

Forgot?
Message appears properly when you click resend

Error message is properly shown for SAML users

iOS
Android