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-10] HOLD on #49532 [$250] Close account - Continue button becomes dysfunctional after closing an Expensifail account #48941

Closed
2 of 6 tasks
IuliiaHerets opened this issue Sep 10, 2024 · 30 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 Sep 10, 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.31-12
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Sign up with a new Expensifail account on staging.new.expensify.com
  2. Create a workspace
  3. Close the account
  4. Try to sign in with another account

Expected Result:

Continue button takes user to the magic code page

Actual Result:

Continue button stops working

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6598750_1725977668088.bandicam_2024-09-10_17-07-53-972.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021836048383075873170
  • Upwork Job ID: 1836048383075873170
  • Last Price Increase: 2024-09-17
  • Automatic offers:
    • jjcoffee | Reviewer | 104042768
    • dominictb | Contributor | 104042769
Issue OwnerCurrent Issue Owner: @muttmuure
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 10, 2024
Copy link

melvin-bot bot commented Sep 10, 2024

Triggered auto assignment to @muttmuure (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

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

@dominictb
Copy link
Contributor

dominictb commented Sep 11, 2024

Edited by proposal-police: This proposal was edited at 2024-09-11 02:28:02 UTC.

Proposal

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

  • Continue button stops working

What is the root cause of that problem?

  • After calling API to close the account, the session onyx data is clear. Then, it navigates user to sign in page.

  • In here, we call API update automatic timezone here, we don't check whether the current user account ID is available or not.

  • That leads to the networkRequestQueue data is not empty (its length > 0).

  • Then we type a new email then press on "Continue", which will trigger the read API.

  • And because the read API is only called once the networkRequestQueue is empty, clicking on the "Continue" button does not seem to work until networkRequestQueue is empty.

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

  • In here, we can early return if session.accountID is undefined.
  • The session data is from here.

What alternative solutions did you explore? (Optional)

Option 1:

  • In here we can set currentAccountID = -1;

Option 2:

  • We can disable the "Continue" button or display the loading indicator in BaseLoginForm if the networkRequestQueue is not empty.

@melvin-bot melvin-bot bot added the Overdue label Sep 13, 2024
Copy link

melvin-bot bot commented Sep 16, 2024

@muttmuure Eep! 4 days overdue now. Issues have feelings too...

@muttmuure muttmuure added the External Added to denote the issue can be worked on by a contributor label Sep 17, 2024
Copy link

melvin-bot bot commented Sep 17, 2024

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

@melvin-bot melvin-bot bot changed the title Close account - Continue button becomes dysfunctional after closing an Expensifail account [$250] Close account - Continue button becomes dysfunctional after closing an Expensifail account Sep 17, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 17, 2024
Copy link

melvin-bot bot commented Sep 17, 2024

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

@jjcoffee
Copy link
Contributor

Thanks for the proposal @dominictb!

we call API update automatic timezone here, we don't check whether the current user account ID is available or not.

I'm not sure I understand why we call this only in this situation (closing an account), can you clarify that? It sounds almost like there's something missing when we close the account (e.g. some Onyx value that isn't being reset).

I'm also a bit confused overall on your RCA, are you saying that the networkRequestQueue never empties because the updateAutomaticTimezone call is returning an error and therefore retrying and clogging up the queue indefinitely?

@dominictb
Copy link
Contributor

I'm not sure I understand why we call this only in this situation (closing an account)

  • When we close account, the session data has no accountID, so we set timezone to null in:
    key: ONYXKEYS.SESSION,
    callback: (value) => {
    // When signed out, val hasn't accountID
    if (!(value && 'accountID' in value)) {
    timezone = null;
    return;

but the currentAccountID is not cleared, it still stores the session.accountID value when we did not close account.

I'm also a bit confused overall on your RCA, are you saying that the networkRequestQueue never empties because the updateAutomaticTimezone call is returning an error and therefore retrying and clogging up the queue indefinitely

Yes. You can try it by opening "Inspect" > "Application" > "IndexedDB" > "OnyxDB" > "keypairValue" > Observer the "NetworkRequestQueue" key after we close account.

@jjcoffee
Copy link
Contributor

the currentAccountID is not cleared, it still stores the session.accountID value when we did not close account.

Isn't this the overall RCA here then? If we update currentAccountID once the account is deleted, it sounds like the issue would be solved. Or is there some reason for not doing that?

@dominictb
Copy link
Contributor

If we update currentAccountID once the account is deleted, it sounds like the issue would be solved

Yes. I updated my proposal to include that solution.

@jjcoffee
Copy link
Contributor

Sounds good! Let's go with @dominictb's proposal, probably following the idea to set currentAccountID to -1 (we may tweak this on the PR if necessary).

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 19, 2024

Triggered auto assignment to @yuwenmemon, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 19, 2024
Copy link

melvin-bot bot commented Sep 19, 2024

📣 @jjcoffee 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Sep 19, 2024

📣 @dominictb 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@dominictb
Copy link
Contributor

@jjcoffee I cannot close the account now, the CTA button is loading infinitely, Can you help check?

Screen.Recording.2024-09-20.at.16.07.03.mov

@jjcoffee
Copy link
Contributor

@dominictb Hmm yeah I get the same on staging.

@dominictb
Copy link
Contributor

I think that issue is reported in here.

@muttmuure muttmuure removed the Overdue label Sep 25, 2024
@melvin-bot melvin-bot bot added the Overdue label Sep 25, 2024
@muttmuure muttmuure added the Weekly KSv2 label Sep 25, 2024
@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Weekly KSv2 labels Sep 27, 2024
@dominictb
Copy link
Contributor

@jjcoffee The loading issue is fixed. PR is ready.

@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 3, 2024
@melvin-bot melvin-bot bot changed the title HOLD on #49532 [$250] Close account - Continue button becomes dysfunctional after closing an Expensifail account [HOLD for payment 2024-10-10] HOLD on #49532 [$250] Close account - Continue button becomes dysfunctional after closing an Expensifail account Oct 3, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 3, 2024
Copy link

melvin-bot bot commented Oct 3, 2024

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

Copy link

melvin-bot bot commented Oct 3, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.43-6 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-10. 🎊

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

Copy link

melvin-bot bot commented Oct 3, 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:

  • [@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.
  • [@muttmuure] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 9, 2024
@jjcoffee
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: fix timezone on profile with new account #23631 (this seems like the ultimate source)
  • 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: https://github.com/Expensify/App/pull/23631/files#r1795617216
  • 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 - closing account needed to be tested
  • Determine if we should create a regression test for this bug. Yes
  • 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

  1. Sign up with a new account.
  2. Close the account
  3. With DevTools or logging open, try to sign in with another account.
  4. Verify there is no UpdateAutomaticTimezone call in the logs.
  5. Verify that the continue button works normally, moving to the magic code page without any delay.

Do we agree 👍 or 👎

@jjcoffee
Copy link
Contributor

@muttmuure Friendly bump for payment, thanks! 🙏

@melvin-bot melvin-bot bot added the Overdue label Oct 11, 2024
Copy link

melvin-bot bot commented Oct 14, 2024

@yuwenmemon, @jjcoffee, @muttmuure, @dominictb Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Oct 16, 2024

@yuwenmemon, @jjcoffee, @muttmuure, @dominictb Still overdue 6 days?! Let's take care of this!

@muttmuure
Copy link
Contributor

Paid

@melvin-bot melvin-bot bot removed the Overdue label Oct 17, 2024
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
None yet
Development

No branches or pull requests

5 participants