Skip to content

[HOLD for payment 2023-09-20] [$500] Log in - Unable to login after Closing an account #25793

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Login to Account A.
  2. Navigate to account settings and close the account.
  3. After being redirected back to the login page, log in to other account - Account B.
  4. Access Account B's email inbox and open the email containing the "magic sign-in link."
  5. Click on the sign-in link > This action should open the app.
    (we must login via attached link in the email)
  6. Observer: Unable to login to account B, the app gets stuck loading

Expected Result:

The user should be able to log in without any issue

Actual Result:

Unable to log in after closing an account. Users have to un-install and re-install app to login again

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.56-19

Reproducible in staging?: Yes

Reproducible in production?: Yes

If this was caught during regression testing, add the test name, ID and link from TestRail:

Email or phone of affected tester (no customers):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

Unable-to-login-via-link-22.August.MP4
0-02-01-e1e1c5a4ee2f11b58890a84aad38529ae4a3104fc1ed9626c48c4ac8a393a8f8_ab92111009d31f2a.1.mp4

Expensify/Expensify Issue URL:

Issue reported by:@tranvantoan-qn

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691850473918269

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012f681206489deb34
  • Upwork Job ID: 1695137778067378176
  • Last Price Increase: 2023-08-25
  • Automatic offers:
    • jjcoffee | Reviewer | 26375721
    • b4s36t4 | Contributor | 26375723

Activity

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

    @melvin-bot

    Triggered auto assignment to @NicMendonca (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. melvin-bot commented on Aug 23, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  4. tranvantoan-qn commented on Aug 23, 2023

    @tranvantoan-qn

    Please note that the steps 4 and 5 are key (the issue won't happen if we login again by entering the Magic Code directly)

  5. NicMendonca commented on Aug 23, 2023

    @NicMendonca
    Contributor

    The issue won't happen if we login again by entering the Magic Code

    @tranvantoan-qn as opposed to?

  6. tranvantoan-qn commented on Aug 23, 2023

    @tranvantoan-qn

    @NicMendonca ah, it is just a note to make sure you are not reproducing the issue that way

  7. b4s36t4 commented on Aug 24, 2023

    @b4s36t4
    Contributor

    Proposal

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

    Log in - Unable to login after Closing an account

    What is the root cause of that problem?

    The infinite login is because of this line

    NetworkConnection.onReconnect(() => App.reconnectApp(this.props.lastUpdateIDAppliedToClient));

    Here we listen for application state weather it is inactive or active or in background, because of this line when ever we leave the application for magic code app becomes inactive, when we visit the app again via deeplink this callback will get called.

    And since the we use persisted network and the way we designed it always calling the reconnectApp because reconnectApp is the first in the queue. And because we're not authenticated this request will give 407 code which causes infinite network request which made SigninUserWithLink command to not execute which causing the loader to be shown here.

    And the reason the above onReconnect callback would execute is the main RCA here which involves the issue above I said.

    We've added this listener in AuthScreens component which will only render if we're authenticated once we're logged in and signout we removed the listener here in this line

    NetworkConnection.clearReconnectionCallbacks();
    which will be called when we click on signout.

    But this won't happen in case of Closing the account, because of the listener still active because we're loggedin this listener will be active when we click on close account even though we're not part of AuthScreens component anymore listener is still active this causing the issue when we leave the app to call reconnectApp command to go on top of the queue.

    It doesn't have to be Magic code page, after close account action once you make the app background (do 2-3 times to be effective) and this time you can't even go next step from Email page.

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

    We can solve this two ways

    1. Call Network.clearReconnectionCallbacks in User.js at closeAccount function

    2. Call Network.clearReconnectionCallbacks function here

      componentWillUnmount() {
      in componentWillUnmount function

    What alternative solutions did you explore? (Optional)

    NA

  8. b4s36t4 commented on Aug 24, 2023

    @b4s36t4
    Contributor

    Result for #25793 (comment)

    Kapture.2023-08-24.at.22.41.10.mp4

    Sorry for the long video.

  9. NicMendonca commented on Aug 24, 2023

    @NicMendonca
    Contributor

    I am failing to see how this is not an edge case. Without SAML, you can only log in with a magic code, and it is very unlikely a user is going to have two accounts, and try to follow these steps on iOS native specifically. I am going to close this for now.

  10. b4s36t4 commented on Aug 24, 2023

    @b4s36t4
    Contributor

    @NicMendonca it doesn't have to be different accounts and I don't feel this can be closed.

    You can follow these below steps to re-produce this.

    1. Login with any account, from secrity settings close the account.
    2. From login screen don't do anything, move the app to background (do this 2-3) times.
    3. Now try to login with any email.. you won't be able to move forward even for OTP screen.

    Once we close the account and after re-directing to signin page again after that if we move app to the background user won't be able to login anymore. Doesn't have to be different account.

    If you want I can make a clear video on how to re-produce this.

  11. tranvantoan-qn commented on Aug 24, 2023

    @tranvantoan-qn

    @NicMendonca
    This one is critical and should not be close:

    1. it happens for all accounts, not ony different one (I mention other account in the step because there might be the case you was using .expensifal, after closing it, you wont be able to re-login with error can not get account details before enter magic code screen)
    2. Once the issue happens, there is no way to use app again, user must re-install app
  12. b4s36t4 commented on Aug 24, 2023

    @b4s36t4
    Contributor

    Yes, I agree with @tranvantoan-qn I have witnessed it.

  13. 40 remaining items

  14. melvin-bot commented on Sep 13, 2023

    @melvin-bot

    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:

    • [@jjcoffee] The PR that introduced the bug has been identified. Link to the PR:
    • [@jjcoffee] 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:
    • [@jjcoffee] 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:
    • [@jjcoffee] Determine if we should create a regression test for this bug.
    • [@jjcoffee] 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.
    • [@NicMendonca] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  15. tranvantoan-qn commented on Sep 13, 2023

    @tranvantoan-qn

    I'm waiting the offer for Reporter Role

  16. jjcoffee commented on Sep 18, 2023

    @jjcoffee
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: N/A - missed case in closeAccount
    • 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: N/A
    • 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: N/A
    • Determine if we should create a regression test for this bug. No - not impactful enough
    • 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. N/A
  17. NicMendonca commented on Sep 20, 2023

    @NicMendonca
    Contributor
  18. tranvantoan-qn commented on Sep 20, 2023

    @tranvantoan-qn

    Thank you! I've applied for the job

  19. NicMendonca commented on Sep 20, 2023

    @NicMendonca
    Contributor
  20. jjcoffee commented on Sep 20, 2023

    @jjcoffee
    Contributor

    @NicMendonca I think you've miscalculated the timeliness bonus? Should be $250 now 😄

  21. b4s36t4 commented on Sep 20, 2023

    @b4s36t4
    Contributor

    I have seen same kind of calculations 😅 in some other issues. Maybe bonus is 100%??

  22. b4s36t4 commented on Sep 20, 2023

    @b4s36t4
    Contributor

    I have received in amount in my account 😄.

  23. NicMendonca commented on Sep 20, 2023

    @NicMendonca
    Contributor

    😬 Opps. I added a $500 (50%) bonus, forgetting this was changed to $500 (down from $1000).

    I will make note of this for next time 🙇‍♀️

  24. b4s36t4 commented on Sep 20, 2023

    @b4s36t4
    Contributor

    Hey, @NicMendonca What about the extra amount received? any way to revert?

  25. NicMendonca commented on Sep 20, 2023

    @NicMendonca
    Contributor

    @b4s36t4 unfortunately no! But appreciate your honestly lol

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions