Skip to content

[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

Description

@IuliiaHerets

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com 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): applausetester+jp_322824@applause.expensifail.com
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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 22, 2024
  2. melvin-bot commented on Aug 22, 2024

    @melvin-bot

    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.

  3. IuliiaHerets commented on Aug 22, 2024

    @IuliiaHerets
    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

  4. Amoralchik commented on Aug 23, 2024

    @Amoralchik
    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 />}
            </>
        );
  5. melvin-bot commented on Aug 26, 2024

    @melvin-bot

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

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 27, 2024
  7. 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[/+] on Aug 27, 2024
  8. melvin-bot commented on Aug 27, 2024

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 27, 2024
  10. melvin-bot commented on Aug 27, 2024

    @melvin-bot

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

  11. 57 remaining items

  12. bernhardoj commented on Oct 9, 2024

    @bernhardoj
    Contributor

    Requested in ND.

  13. parasharrajat commented on Oct 9, 2024

    @parasharrajat
    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 👎 ?

  14. greg-schroeder commented on Oct 11, 2024

    @greg-schroeder
    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

  15. 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[/+] on Oct 11, 2024
  16. melvin-bot commented on Oct 14, 2024

    @melvin-bot

    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
  17. greg-schroeder commented on Oct 14, 2024

    @greg-schroeder
    Contributor

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

  18. greg-schroeder commented on Oct 14, 2024

    @greg-schroeder
    Contributor

    Adding regression test, closing!

  19. JmillsExpensify commented on Oct 15, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  20. parasharrajat commented on Dec 12, 2024

    @parasharrajat
    Member

    Payment requested as per #47883 (comment)

  21. JmillsExpensify commented on Dec 16, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @parasharrajat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions