Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.56k stars 2.9k forks source link

[HOLD for payment 2024-08-05] Update the magic code expired page to include a link to take user to login page #45242

Closed techievivek closed 2 months ago

techievivek commented 4 months ago

This is how the magic code sign-in page currently looks when you validate via link from the email. Screenshot 2024-06-07 at 12 50 50 PM

It includes a link to allow users to log in on the same device. However, the magic code expiration page lacks this convenience. Users must manually change the URL to initiate a sign-in.

To improve the user experience, please update the magic code expiration page to include a link that redirects the user back to the sign-in page.

Screenshot 2024-06-07 at 12 51 05 PM

This issue was discussed internally here: Slack Discussion

Copy for verification

Go back to the original device and request a new code or request one here

request one here can be used as hyperlink to take user to sign-in page.

melvin-bot[bot] commented 4 months ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @ZhenjaHorbach (External)

melvin-bot[bot] commented 4 months ago

Triggered auto assignment to @anmurali (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

devguest07 commented 4 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Update the magic code expired page to include a link to take user to login page

What is the root cause of that problem?

New feature

What changes do you think we should make in order to solve the problem?

on ExpiredValidateCodeModal add a link <TextLink onPress={goToSignIn}v ... that redirect the user the signin page

https://github.com/Expensify/App/blob/978b833cf10aa22f3f20257f645e31a2f64492b3/src/components/ValidateCode/ExpiredValidateCodeModal.tsx#L28

We can use the Session.signOutAndRedirectToSignIn() as used on the AnonymousReportFooter

https://github.com/Expensify/App/blob/978b833cf10aa22f3f20257f645e31a2f64492b3/src/components/AnonymousReportFooter.tsx#L54

What alternative solutions did you explore?

nkdengineer commented 4 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Update the magic code expired page to include a link to take user to login page

What is the root cause of that problem?

New feature

What changes do you think we should make in order to solve the problem?

In https://github.com/Expensify/App/blob/a2f29e50bd5816e1756cded43ffaf6f02e5a276f/src/languages/en.ts#L436, add a translation for request one here

requestOneHere: 'request one here',

And update translation for expiredCodeDescription to remove the ending dot.

In https://github.com/Expensify/App/blob/a2f29e50bd5816e1756cded43ffaf6f02e5a276f/src/components/ValidateCode/ExpiredValidateCodeModal.tsx#L15, get the credentials from Onyx

const [credentials] = useOnyx(ONYXKEYS.CREDENTIALS);

Next, update https://github.com/Expensify/App/blob/a2f29e50bd5816e1756cded43ffaf6f02e5a276f/src/components/ValidateCode/ExpiredValidateCodeModal.tsx#L28 to

<Text style={styles.textAlignCenter}>
    {translate('validateCodeModal.expiredCodeDescription')}
    {translate('validateCodeModal.or')} <TextLink onPress={() => {
        Session.beginSignIn(credentials?.login);
        Navigation.goBack();
    }}>{translate('validateCodeModal.requestOneHere')}</TextLink>
</Text>

In there, we'll trigger sending the magic code again by calling Session.beginSignIn, this is what we also do when clicking Continue the first time here. Please note that requesting a new code is what we want, not clearing the account data, because the CTA here is request one here, the user wants a new magic code/email, they will not like to enter the email again and type in the code again (which is what will happen if we call sign out/clear sign in data)

And the Navigation.goBack will direct the user back to the sign in page, where they will see the magic code form to fill in the new code that they just received. (Alternatively we can navigate back to sign in page by other means like Navigation.navigate, ...)

The copy above can be changed depending on the design team's requirement.

What alternative solutions did you explore? (Optional)

ZhenjaHorbach commented 4 months ago

@devguest07 @nkdengineer Thank you for your proposals !

@devguest07 Unfortunately, your solution works a little unpredictable After testing, I noticed that after pressing the text we return to the magic code sign-in page (with invalid magic code from route)

https://github.com/Expensify/App/assets/68128028/f07a245b-a317-4ed0-82d9-7ae033bb2de4

Plus signOutAndRedirectToSignIn doesn't really suit us Since we don't need to sign out of our account We need to return to the screen to request new code (following the requirements)

@nkdengineer Your solution works well ! And meets the requirements So I'm happy to go with this proposal

🎀👀🎀 C+ reviewed

melvin-bot[bot] commented 4 months ago

Current assignee @techievivek is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] commented 3 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] commented 3 months ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 3 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.13-4 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-08-05. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 3 months ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

melvin-bot[bot] commented 3 months ago

Payment Summary

[Upwork Job]()

BugZero Checklist (@anmurali)

ZhenjaHorbach commented 3 months ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [x] [@ZhenjaHorbach] The PR that introduced the bug has been identified. Link to the PR:

New feature

  • [x] [@ZhenjaHorbach] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:

NA

  • [x] [@ZhenjaHorbach] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

NA

  • [x] [@ZhenjaHorbach] Determine if we should create a regression test for this bug.
  • [x] [@ZhenjaHorbach] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Regression test proposal

Do we agree 👍 or 👎

ZhenjaHorbach commented 3 months ago

Not overdue Waiting for payment

techievivek commented 3 months ago

Not overdue, waiting for the payment to be done.

ZhenjaHorbach commented 3 months ago

Not overdue

@anmurali Could you please make the payment ?

techievivek commented 3 months ago

Not overdue, still waiting on payment.

anmurali commented 3 months ago

@ZhenjaHorbach - https://www.upwork.com/nx/wm/offer/103567268 @nkdengineer -https://www.upwork.com/nx/wm/offer/103567272

nkdengineer commented 3 months ago

@anmurali My offer was accepted 🙇

ZhenjaHorbach commented 3 months ago

My offer was accepte

and mine too

ZhenjaHorbach commented 2 months ago

Not overdue

@anmurali We are ready to payment !

melvin-bot[bot] commented 2 months ago

@anmurali, @techievivek, @ZhenjaHorbach, @nkdengineer Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

anmurali commented 2 months ago

Everyone is paid and regression test added.