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

[HOLD for payment 2024-10-14] [$250] Sign in–Magic code expired appears briefly if use Request one here link & login via magic link #47883

Closed
2 of 6 tasks
IuliiaHerets opened this issue Aug 22, 2024 · 49 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Aug 22, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.24-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4886771
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. On the log in screen, enter a new account email
  3. Repeat the previous step with the same email - This is to receive 2 validation links
  4. Navigate to the account email inbox and open the first email of the 2
  5. Copy the magic link and change it to staging
  6. Navigate to the staging link
  7. Verify Magic code expired page opens
  8. Click on Request one here link
  9. Navigate to the account email inbox and open the email
  10. Copy the magic link, change it to staging and navigate to the staging link

Expected Result:

Magic code expired not appears briefly

Actual Result:

Magic code expired appears briefly

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6579619_1724356216934.MC.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015ba582e21228c322
  • Upwork Job ID: 1828311848767754708
  • Last Price Increase: 2024-09-10
Issue OwnerCurrent Issue Owner: @greg-schroeder
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 22, 2024
Copy link

melvin-bot bot commented Aug 22, 2024

Triggered auto assignment to @greg-schroeder (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.

@IuliiaHerets
Copy link
Author

@greg-schroeder FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@Amoralchik
Copy link
Contributor

Proposal

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

The user sees the ValidateCodeModal instead of a loading screen when accessing the magic link.

What is the root cause of that problem?

Here in ValidateLoginPage:

{(!session?.autoAuthState ? !shouldStartSignInWithValidateCode : autoAuthState === CONST.AUTO_AUTH_STATE.NOT_STARTED) && !exitTo && (

This condition returns true even when shouldStartSignInWithValidateCode is true. This caused the ValidateCodeModal to be shown to the user.

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

By changing the condition to
!shouldStartSignInWithValidateCode && autoAuthState === CONST.AUTO_AUTH_STATE.NOT_STARTED && !exitTo
By this we can prevent the display ValidateCodeModal, and we can display the Loading Indicator instead of the ValidateCodeModal including it in the condition for FullScreenLoadingIndicator.
I suggest making the changes as follows:

    // If session.autoAuthState isn't available yet, we use shouldStartSignInWithValidateCode to conditionally render the component instead of local autoAuthState which contains a default value of NOT_STARTED
    const shouldValidateModal = !shouldStartSignInWithValidateCode && autoAuthState === CONST.AUTO_AUTH_STATE.NOT_STARTED && !exitTo;
    const isFailed = autoAuthState === CONST.AUTO_AUTH_STATE.FAILED;
    const isJustSignedIn2FA = autoAuthState === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN && is2FARequired && !isSignedIn && login;
    const isJustSignedIn = autoAuthState === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN && isSignedIn && !exitTo && login;

    return (
        <>
            {isFailed && <ExpiredValidateCodeModal />}
            {isJustSignedIn2FA && <JustSignedInModal is2FARequired />}
            {isJustSignedIn && <JustSignedInModal is2FARequired={false} />}
            {shouldValidateModal && (
                <ValidateCodeModal
                    accountID={Number(accountID)}
                    code={validateCode}
                />
            )}
            {!shouldValidateModal && !isJustSignedIn && !isJustSignedIn2FA && <FullScreenLoadingIndicator />}
        </>
    );

@melvin-bot melvin-bot bot added the Overdue label Aug 26, 2024
Copy link

melvin-bot bot commented Aug 26, 2024

@greg-schroeder Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@greg-schroeder greg-schroeder added the External Added to denote the issue can be worked on by a contributor label Aug 27, 2024
@melvin-bot melvin-bot bot changed the title Sign in–Magic code expired appears briefly if use Request one here link & login via magic link [$250] Sign in–Magic code expired appears briefly if use Request one here link & login via magic link Aug 27, 2024
Copy link

melvin-bot bot commented Aug 27, 2024

Job added to Upwork: https://www.upwork.com/jobs/~015ba582e21228c322

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 27, 2024
Copy link

melvin-bot bot commented Aug 27, 2024

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

@greg-schroeder
Copy link
Contributor

Looks like we have one proposal to review when you get a chance, Rajat!

@bernhardoj
Copy link
Contributor

Proposal

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

The magic code expired is shown briefly when open the magic link for the 2nd time.

What is the root cause of that problem?

When we open the expired magic link for the first time, the session.autoAuthState is FAILED. When we reopen the 2nd magic link, the state is still the same, FAILED, so the magic code expired view is shown briefly.

{autoAuthState === CONST.AUTO_AUTH_STATE.FAILED && <ExpiredValidateCodeModal />}

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

I suggest that we clear the autoAuthState when pressing the request one here text,

<TextLink
onPress={() => {
Session.beginSignIn(credentials?.login ?? '');
Navigation.setNavigationActionToMicrotaskQueue(Navigation.goBack);
}}
>
{translate('validateCodeModal.requestOneHere')}
</TextLink>

function clearAutoAuthState() {
    Onyx.merge(ONYXKEYS.SESSION, {autoAuthState: null});
}
...
onPress={() => {
    Session.clearAutoAuthState();
    ...
})

@parasharrajat
Copy link
Member

Checking...

Copy link

melvin-bot bot commented Sep 2, 2024

@parasharrajat, @greg-schroeder Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot added the Overdue label Sep 2, 2024
@parasharrajat
Copy link
Member

Couldn't spend much time testing this bug on Friday. Going to look more in the bug before picking up a proposal.

@melvin-bot melvin-bot bot removed the Overdue label Sep 2, 2024
Copy link

melvin-bot bot commented Sep 3, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Sep 5, 2024

@parasharrajat @greg-schroeder this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Sep 5, 2024
@greg-schroeder
Copy link
Contributor

Let me know how you go @parasharrajat!

Copy link

melvin-bot bot commented Sep 6, 2024

@parasharrajat, @greg-schroeder Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot removed the Overdue label Sep 6, 2024
@parasharrajat
Copy link
Member

I will check this tomorrow.

@greg-schroeder
Copy link
Contributor

greg-schroeder commented Oct 3, 2024

Thanks for the update @fabioh8010! Looks like @MonilBhavsar you're back up for a new review <3

Copy link

melvin-bot bot commented Oct 4, 2024

⚠️ 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 melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 4, 2024
@melvin-bot melvin-bot bot changed the title [$250] Sign in–Magic code expired appears briefly if use Request one here link & login via magic link [HOLD for payment 2024-10-11] [$250] Sign in–Magic code expired appears briefly if use Request one here link & login via magic link Oct 4, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 4, 2024
Copy link

melvin-bot bot commented Oct 4, 2024

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

Copy link

melvin-bot bot commented Oct 4, 2024

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

If no regressions arise, payment will be issued on 2024-10-11. 🎊

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

Copy link

melvin-bot bot commented Oct 4, 2024

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:

  • [@parasharrajat] The PR that introduced the bug has been identified. Link to the PR:
  • [@parasharrajat] 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:
  • [@parasharrajat] 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:
  • [@parasharrajat] Determine if we should create a regression test for this bug.
  • [@parasharrajat] 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.
  • [@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 7, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-10-11] [$250] Sign in–Magic code expired appears briefly if use Request one here link & login via magic link [HOLD for payment 2024-10-14] [HOLD for payment 2024-10-11] [$250] Sign in–Magic code expired appears briefly if use Request one here link & login via magic link Oct 7, 2024
Copy link

melvin-bot bot commented Oct 7, 2024

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

If no regressions arise, payment will be issued on 2024-10-14. 🎊

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

Copy link

melvin-bot bot commented Oct 7, 2024

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:

  • [@parasharrajat] The PR that introduced the bug has been identified. Link to the PR:
  • [@parasharrajat] 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:
  • [@parasharrajat] 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:
  • [@parasharrajat] Determine if we should create a regression test for this bug.
  • [@parasharrajat] 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.
  • [@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@greg-schroeder
Copy link
Contributor

greg-schroeder commented Oct 8, 2024

Payment summary:

Contributor: @bernhardoj - $250 - Can make a manual request via ND to be paid on 10/14
C+: @parasharrajat - $250 - Can make a manual request via ND to be paid on 10/14

@bernhardoj
Copy link
Contributor

Requested in ND.

@parasharrajat
Copy link
Member

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:

Regression Test Steps

  1. Log out from the app
  2. Enter your login once
  3. Go back
  4. Enter your login again. Verify you receive 2 magic code & link emails
  5. Open the first email magic link
  6. Verify a magic code expired is shown
  7. Open the second email magic link
  8. Verify a magic code expired isn't shown briefly

Do you agree 👍 or 👎 ?

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 11, 2024
@greg-schroeder
Copy link
Contributor

Oops - regression period is actually 10/14 because the 10/11 date is for the Onyx bump PR, not the PR that fixes this. Updated

@greg-schroeder greg-schroeder changed the title [HOLD for payment 2024-10-14] [HOLD for payment 2024-10-11] [$250] Sign in–Magic code expired appears briefly if use Request one here link & login via magic link [HOLD for payment 2024-10-14] [$250] Sign in–Magic code expired appears briefly if use Request one here link & login via magic link Oct 11, 2024
@melvin-bot melvin-bot bot added the Overdue label Oct 14, 2024
Copy link

melvin-bot bot commented Oct 14, 2024

Payment Summary

Upwork Job

BugZero Checklist (@greg-schroeder)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1828311848767754708/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@greg-schroeder
Copy link
Contributor

All right, these manual requests can be approved per #47883 (comment)

@melvin-bot melvin-bot bot removed the Overdue label Oct 14, 2024
@greg-schroeder
Copy link
Contributor

Adding regression test, closing!

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Status: No status
Development

No branches or pull requests

8 participants