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 2023-12-28] [$500] Login - "Account closed successfully" on login screen not shown for old existing accounts #32733

Closed
2 of 6 tasks
lanitochka17 opened this issue Dec 8, 2023 · 29 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

@lanitochka17
Copy link

lanitochka17 commented Dec 8, 2023

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: 1.4.10-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:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Log in New Expensify with an old existing account
  2. Navigate to Settings > Security > Close account
  3. Enter default contact method and close account

Expected Result:

User should be redirected to the log in page and an "Account closed successfully" message should be displayed below email field

Actual Result:

User is redirected to the log in page. However, the message indicating account closure is not shown
Notes:
Issue is not reproducible with completely new accounts

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence

Bug6305807_1702050927436.2023-12-08_16-24-44.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011705658b0d3f1aa4
  • Upwork Job ID: 1733186029523935232
  • Last Price Increase: 2023-12-08
  • Automatic offers:
    • bernhardoj | Contributor | 28042756
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 8, 2023
@melvin-bot melvin-bot bot changed the title Login - "Account closed successfully" on login screen not shown for old existing accounts [$500] Login - "Account closed successfully" on login screen not shown for old existing accounts Dec 8, 2023
Copy link

melvin-bot bot commented Dec 8, 2023

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

Copy link

melvin-bot bot commented Dec 8, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 8, 2023
Copy link

melvin-bot bot commented Dec 8, 2023

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

Copy link

melvin-bot bot commented Dec 8, 2023

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

@shubham1206agra
Copy link
Contributor

@ZhenjaHorbach, Your RCA is wrong. I have tested this. Its closing the account.
@stephanieelliott Can we check the backend for this? It looks like a backend issue as success message comes from backend

@ZhenjaHorbach
Copy link
Contributor

Yeah
Sorry

But what's interesting is that we expect the parameter here
Which should be responsible for the error message

https://github.com/Expensify/App/blob/6e11da581e1322b144abc0a1220bd7acac9f25ea/src/libs/actions/User.js#L72C1-L73

@shubham1206agra
Copy link
Contributor

Ah, maybe I can guess the problem here. And why the problem is with the old account only?

@shubham1206agra
Copy link
Contributor

Yeah Sorry

But what's interesting is that we expect the parameter here Which should be responsible for the error message

The parameter is optional in that

@shubham1206agra
Copy link
Contributor

@ZhenjaHorbach Do you have an old account which can be deleted?

@ZhenjaHorbach
Copy link
Contributor

Unfortunately, no longer)

@shubham1206agra
Copy link
Contributor

shubham1206agra commented Dec 8, 2023

Do you have onyx response while closing the account?
And maybe try re-login to the account

@ZhenjaHorbach
Copy link
Contributor

Screenshot 2023-12-08 at 21 41 38

Actually yes
The account remains)
The problem is that we are not successfully deleting our account

So we probably need to fix the unsuccessful deletion
And display a new message
That we cannot delete an account

@bernhardoj
Copy link
Contributor

Proposal

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

Closing an account doesn't show the success message.

What is the root cause of that problem?

We can reproduce this with an account that has a workspace with other members in it. When we close the account, we will get an error, so the close account is actually not successful, but we always redirect the user to sign in no matter the API result.

// Run cleanup actions to prevent reconnection callbacks from blocking logging in again
redirectToSignIn();

It's to fix this issue #25793 where NetworkConnection listener is never cleared when we sign out. The C+ then suggest to use redirectToSignIn as it also clears other things on sign out.

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

We shouldn't call redirectToSignIn immediately every time we press close account. Instead, we can clear the NetworkConnection listener when AuthScreens component unmounts.

return () => {
unsubscribeShortcutsOverviewShortcut();
unsubscribeSearchShortcut();
unsubscribeChatShortcut();
Session.cleanupSession();
};

NetworkConnection.clearReconnectionCallbacks();

or

redirectToSignIn()

@melvin-bot melvin-bot bot added the Overdue label Dec 11, 2023
@narefyev91
Copy link
Contributor

Proposal from @bernhardoj looks good to me #32733 (comment)
We should correctly clean data and not just swap it in all cases. Also we should check that new logic will also work for #25793 - and we will not get more regressions
🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Overdue label Dec 11, 2023
Copy link

melvin-bot bot commented Dec 11, 2023

Triggered auto assignment to @Gonals, 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 Dec 12, 2023
Copy link

melvin-bot bot commented Dec 12, 2023

📣 @bernhardoj 🎉 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 📖

@bernhardoj
Copy link
Contributor

bernhardoj commented Dec 12, 2023

@narefyev91 before opening the PR, I'm thinking of a different approach to the solution. The concept is still the same. We still won't call redirectToSignIn immediately after pressing the close account button.

The concern I have is, if we call redirectToSignIn() when AuthScreens is unmounted, redirectToSignIn() will be called twice when we press Sign Out from the settings page (we call redirectToSignIn when pressing sign out). There is no problem so far with it but I'm thinking of a cleaner way to do the sign-out cleanup.

What if we move all cleanup (except clearStorageAndRedirect) from redirectToSignIn to Session.cleanupSession?

function redirectToSignIn(errorMessage?: string) {
MainQueue.clear();
HttpUtils.cancelPendingRequests();
PersistedRequests.clear();
NetworkConnection.clearReconnectionCallbacks();
clearStorageAndRedirect(errorMessage);
resetHomeRouteParams();
SessionUtils.resetDidUserLogInDuringSession();
}

/**
* Put any logic that needs to run when we are signed out here. This can be triggered when the current tab or another tab signs out.
*/
function cleanupSession() {
Pusher.disconnect();
Timers.clearAll();
Welcome.resetReadyCheck();
PriorityMode.resetHasReadRequiredDataFromStorage();
}

return () => {
unsubscribeShortcutsOverviewShortcut();
unsubscribeSearchShortcut();
unsubscribeChatShortcut();
Session.cleanupSession();
};

This way, if the user presses Sign Out, clearStorageAndRedirect will be called to clear the Onyx, and Session.cleanupSession will be called once AuthScreen is unmounted. Session.cleanupSession will always be called when signing out, including when we close the account.

This works fine so far.

What do you think?

@narefyev91
Copy link
Contributor

Yup i think we can try that approach to not having multiple calls for nothing. In any case it's mostly just an order for cleaning data during logout

@bernhardoj
Copy link
Contributor

PR is ready

cc: @narefyev91

@stephanieelliott
Copy link
Contributor

PR is on staging

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 21, 2023
@melvin-bot melvin-bot bot changed the title [$500] Login - "Account closed successfully" on login screen not shown for old existing accounts [HOLD for payment 2023-12-28] [$500] Login - "Account closed successfully" on login screen not shown for old existing accounts Dec 21, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 21, 2023
Copy link

melvin-bot bot commented Dec 21, 2023

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

Copy link

melvin-bot bot commented Dec 21, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.14-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 2023-12-28. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

Copy link

melvin-bot bot commented Dec 21, 2023

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:

  • [@narefyev91] The PR that introduced the bug has been identified. Link to the PR:
  • [@narefyev91] 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:
  • [@narefyev91] 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:
  • [@narefyev91] Determine if we should create a regression test for this bug.
  • [@narefyev91] 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.
  • [@stephanieelliott] 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 Overdue and removed Weekly KSv2 labels Dec 27, 2023
Copy link

melvin-bot bot commented Jan 1, 2024

@Gonals, @narefyev91, @stephanieelliott, @bernhardoj Huh... This is 4 days overdue. Who can take care of this?

1 similar comment
Copy link

melvin-bot bot commented Jan 1, 2024

@Gonals, @narefyev91, @stephanieelliott, @bernhardoj Huh... This is 4 days overdue. Who can take care of this?

@bernhardoj
Copy link
Contributor

I think we are waiting for the checklist

@melvin-bot melvin-bot bot removed the Overdue label Jan 2, 2024
@narefyev91
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR - it was a new functionality - no regressions
  • 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 - N/A

@stephanieelliott
Copy link
Contributor

Summarizing payment on this issue:

Upwork job is here:https://www.upwork.com/jobs/~011705658b0d3f1aa4

@stephanieelliott
Copy link
Contributor

All paid, thanks!

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

7 participants