Skip to content

[Due for payment 2025-03-21] [$250][HIGH] Xero – Can’t enable 2FA after relogin if Xero connection is active #48208

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: v9.0.25-13
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/4899502
Email or phone of affected tester (no customers): ponikarchuks+128824@gmail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Log in
  3. Create a WS
  4. Connect Xero to the WS
  5. Navigate to account settings and disable 2FA
  6. Log out of the account and log back in
  7. Verify that 2FA modal is shown
  8. Click on Enable Two Factor Authentication
  9. Click on Two Factor Authentication in the center panel and complete the 2FA setup flow

Expected Result:

Able to complete the 2FA setup flow

Actual Result:

“Hold up! We need you to validate your account first. To do so, sign back in with a magic code or verify your account here.” message appears

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6585698_1724871770826.2FA.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0199165fd987545c87
  • Upwork Job ID: 1831077661756285595
  • Last Price Increase: 2024-09-10
  • Automatic offers:
    • dukenv0307 | Reviewer | 103989578
Issue OwnerCurrent Issue Owner: @johncschuster

Activity

  1. added
    Daily
    Bug
    on Aug 28, 2024
  2. melvin-bot commented on Aug 28, 2024

    @melvin-bot

    Triggered auto assignment to @johncschuster (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 28, 2024

    @IuliiaHerets
    Author

    @johncschuster 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. bernhardoj commented on Aug 29, 2024

    @bernhardoj
    Contributor

    Proposal

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

    Validate account page shows not found after relogin.

    What is the root cause of that problem?

    From the video, we can see that we open the 2FA page while the app is still loading (and it looks like it loads infinitely on the video). We can replicate this by using "Clear cache and restart".

    When the app is still loading, we don't have the user information yet, so the validated condition is false at this point and a message to validate the account will be shown.

    const isUserValidated = user?.validated;

    {!isUserValidated && <ValidateAccountMessage backTo={ROUTES.SETTINGS_2FA.getRoute(route?.params?.backTo)} />}

    I believe it's the first issue since we don't know yet whether the user is already validated or not, but we still show the message asking the user to validate their account.

    Next, when the user presses the "verify your account here", it will navigate to the contact method details page passing the user email from the loginList object.

    onPress={() => {
    const login = loginList?.[loginNames?.[0]] ?? {};
    Navigation.navigate(ROUTES.SETTINGS_CONTACT_METHOD_DETAILS.getRoute(login?.partnerUserID ?? loginNames?.[0], backTo));

    However, loginList is also not available yet while the app is loading. So, the value is undefined, thus a not found contact method page is shown.

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

    To address the first issue, we can show a loading screen when the user data is not available yet.

    !user ? (<View><FullScreenLoadingIndicator /></View> : ...
    

    For the loginList issue, there are several options. First, we can also show the loading screen if it's empty, so the code becomes:

    (!user || !loginList) ? (<View><FullScreenLoadingIndicator /></View> : ...
    

    Or, we can hide the "verify your account here" text if loginList is not available.

    {translate('bankAccount.validateAccountError.phrase3')}
    <TextLink
    fontSize={variables.fontSizeLabel}
    onPress={() => {
    const login = loginList?.[loginNames?.[0]] ?? {};
    Navigation.navigate(ROUTES.SETTINGS_CONTACT_METHOD_DETAILS.getRoute(login?.partnerUserID ?? loginNames?.[0], backTo));
    }}
    >
    {translate('bankAccount.validateAccountError.phrase4')}
    </TextLink>

    {loginList && (
        {translate('bankAccount.validateAccountError.phrase3')}
        <TextLink ... />
    )}
    

    Or, we can take the login from session.email (or credentials.login or account.primaryLogin)

  5. melvin-bot commented on Sep 3, 2024

    @melvin-bot

    @johncschuster Huh... This is 4 days overdue. Who can take care of this?

  6. added
    External
    on Sep 3, 2024
  7. melvin-bot commented on Sep 3, 2024

    @melvin-bot
  8. changed the title [-]Xero – Can’t enable 2FA after relogin if Xero connection is active[/-] [+][$250] Xero – Can’t enable 2FA after relogin if Xero connection is active[/+] on Sep 3, 2024
  9. added
    Help Wanted
    on Sep 3, 2024
  10. melvin-bot commented on Sep 3, 2024

    @melvin-bot

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

  11. 106 remaining items

  12. johncschuster commented on Mar 14, 2025

    @johncschuster
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] 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:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal Template
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    Test:

    Do we agree 👍 or 👎

  13. added
    Daily
    and removed
    Weekly
    on Mar 20, 2025
  14. johncschuster commented on Mar 20, 2025

    @johncschuster
    Contributor

    Payment Summary

    Contributor: @bernhardoj owed $250 via NewDot
    Contributor+: @dukenv0307 paid $250 via Upwork after regression window ✅

    @dukenv0307 can you complete the BZ Checklist above? Once done and the regression window has passed, I will issue payment. Thanks!

  15. dukenv0307 commented on Mar 21, 2025

    @dukenv0307
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] 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: New feature

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again. Yes

    Regression Test Proposal Template
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Test:

    1. [User A] Connect Xero to a WS
    2. [User A] Invite User B to WS as an admin
    3. [User B] Sign in into the app
    4. [User B] Verify a prompt to enable 2FA is shown
    5. [User B] Press on Enable two-factor authentication
    6. [User B] Verify you are not promoted to validate the account

    Do we agree 👍 or 👎

  16. johncschuster commented on Mar 21, 2025

    @johncschuster
    Contributor

    Payment has been issued to @dukenv0307 via Upwork. @bernhardoj, please request payment via NewDot!

    Payment Summary here

  17. bernhardoj commented on Mar 21, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  18. JmillsExpensify commented on Mar 24, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  19. daledah commented on Mar 26, 2025

    @daledah
    Contributor

    @JmillsExpensify My solution was initially accepted and I was assigned and created a PR before, but the requirements changed afterward and other solution was implemented. There's a merged PR, which was created after mine, used the same solution I originally proposed.

    According to this comment, I think I should be eligible for payment here as well.

    cc @dukenv0307

  20. dukenv0307 commented on Mar 27, 2025

    @dukenv0307
    Contributor

    @JmillsExpensify I think in this case we should pay @daledah as well

    100% due if the contributor drafted a PR and requested a review.

    I'm not sure if the bounty can be down

  21. JmillsExpensify commented on Apr 8, 2025

    @JmillsExpensify
    Contributor

    Payment summary: $250 @daledah via Upwork.

  22. daledah commented on Apr 10, 2025

    @daledah
    Contributor

    Thanks @JmillsExpensify, I accepted the Upwork offer

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions