Skip to content
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

Start Using BeginSignIn command and remove obsolete API command calls #10222

Merged
merged 21 commits into from
Aug 4, 2022

Conversation

yuwenmemon
Copy link
Contributor

@robertjchen please review

Details

Start using the BeginSignIn command added in https://github.com/Expensify/Web-Expensify/pull/34408

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/218743

Tests

  1. Do a normal sign-in flow for a user that already has a validated account, make sure it works properly:
    https://user-images.githubusercontent.com/4741899/182488142-8044224b-396a-46b2-97a2-69599c0ee76d.mp4

  1. With the same account do the same sign in. Click "Forgot?" on the password form.

  2. Make sure you see the following:
    Screen Shot 2022-08-02 at 4 03 52 PM

  3. And that you get send a password reset link email.

  4. Click the "Resend link" button.

  5. Make sure you get another email


  1. Sign in with an email that DOES NOT already have an account

  2. Make sure that right away you see:
    Screen Shot 2022-08-02 at 4 14 01 PM

  3. ...And that you get an email with a sign-in link:

Screen Shot 2022-08-02 at 4 14 25 PM

  1. Before validating that account by clicking the link in the email, sign-in with that account again, make sure that you get an email with a sign-in link again.

  1. Sign-in with a phone number that does not have an account yet, make sure you see the following:
    Screen Shot 2022-08-02 at 4 16 39 PM

  2. And that you get a text message with your magic sign-in link:
    IMG_8397


@yuwenmemon yuwenmemon self-assigned this Aug 2, 2022
@yuwenmemon yuwenmemon requested a review from a team as a code owner August 2, 2022 23:18
@melvin-bot
Copy link

melvin-bot bot commented Aug 2, 2022

Looks like you modified deprecatedAPI.js! To be clear, you should not be adding any code to this file.

Instead, all new API commands should use API.js, and follow our guidelines for writing new API commands.

Unsure if your change is okay? Drop a note in #expensify-open-source!

@melvin-bot melvin-bot bot requested review from luacmartins and removed request for a team August 2, 2022 23:19
Copy link
Contributor

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments. In addition, we have a few places in actions/User.js that still set loading in ONYXKEYS.ACCOUNT. We should update those.

@@ -133,7 +120,7 @@ class SetPasswordPage extends Component {
<View>
<FormAlertWithSubmitButton
buttonText={buttonText}
isLoading={this.props.account.loading || this.props.userSignUp.isValidatingEmail}
isLoading={this.props.account.loading}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be isLoading since we are using that now?

Suggested change
isLoading={this.props.account.loading}
isLoading={this.props.account.isLoading}

Copy link
Contributor

@luacmartins luacmartins Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to update this one to this.props.account.isLoading?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes good catch!

src/pages/signin/ResendValidationForm.js Outdated Show resolved Hide resolved
src/libs/actions/Session/index.js Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
src/pages/SetPasswordPage.js Outdated Show resolved Hide resolved
@yuwenmemon
Copy link
Contributor Author

Trying to figure out how the hell I broke 2 unit tests that don't seem related at all 🤔

@yuwenmemon
Copy link
Contributor Author

Okay updated!

Copy link
Contributor

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the comments! Tests are still failing though!

@yuwenmemon
Copy link
Contributor Author

They are not! 😄

robertjchen
robertjchen previously approved these changes Aug 4, 2022
Copy link
Contributor

@robertjchen robertjchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!!

@@ -133,7 +120,7 @@ class SetPasswordPage extends Component {
<View>
<FormAlertWithSubmitButton
buttonText={buttonText}
isLoading={this.props.account.loading || this.props.userSignUp.isValidatingEmail}
isLoading={this.props.account.loading}
Copy link
Contributor

@luacmartins luacmartins Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to update this one to this.props.account.isLoading?

@yuwenmemon
Copy link
Contributor Author

Updated again!

@luacmartins luacmartins merged commit f3c831d into main Aug 4, 2022
@luacmartins luacmartins deleted the yuwen-beginSignIn branch August 4, 2022 17:56
@OSBotify
Copy link
Contributor

OSBotify commented Aug 4, 2022

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

OSBotify commented Aug 4, 2022

🚀 Deployed to staging by @luacmartins in version: 1.1.88-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants