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-08-01] [$250] Close account - Unable to close unverified account #44114

Closed
3 of 6 tasks
lanitochka17 opened this issue Jun 20, 2024 · 58 comments
Closed
3 of 6 tasks
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 Jun 20, 2024

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.86-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/4652683
Email or phone of affected tester (no customers): natnael.expensify+0a89fdndafadf@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Sign up with a new account
  2. Go to Settings > Security > Close account
  3. Enter default email > click 'Close account'

Expected Result:

Account should be closed

Actual Result:

Account is not closed

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

Bug6519711_1718909872400.Screen_Recording_2024-06-20_at_9.48.20_at_night.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e5a38773a3b72e10
  • Upwork Job ID: 1804323493948615973
  • Last Price Increase: 2024-07-13
  • Automatic offers:
    • mkhutornyi | Reviewer | 103155489
Issue OwnerCurrent Issue Owner: @kevinksullivan / @isabelastisser
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 20, 2024
Copy link

melvin-bot bot commented Jun 20, 2024

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

@lanitochka17
Copy link
Author

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

@cretadn22
Copy link
Contributor

Proposal

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

VBA Link does not sign user in when redirected

What is the root cause of that problem?

the App only call CLOSE_ACCOUNT api. this is the response from BE

Ảnh chụp Màn hình 2024-06-21 lúc 03 34 36

the BE does not remove the session on Onyx

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

API.write(WRITE_COMMANDS.CLOSE_ACCOUNT, parameters, {

We could use signOutAndRedirectToSignIn function to reset the token and navigate to the sign-in page.

What alternative solutions did you explore? (Optional)

we could also remove the session from optimistic data.

@bernhardoj
Copy link
Contributor

Proposal

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

Unable to close unverified account. The request completes but the user isn't logged out.

What is the root cause of that problem?

When the request is completed, there is already a clear onyx command to clear the onyx so the user is logged out. However, when we receive the response, doesClientNeedToBeUpdated returns true which will call OnyxUpdates.saveUpdateInformation which triggers GetMissingOnyxMessages but fails because the account is already closed, so the response onyx data is never applied.

if (requestsToIgnoreLastUpdateID.includes(request.command) || !OnyxUpdates.doesClientNeedToBeUpdated(Number(response?.previousUpdateID ?? 0))) {
return OnyxUpdates.apply(responseToApply);
}
// Save the update IDs to Onyx so they can be used to fetch incremental updates if the client gets out of sync from the server
OnyxUpdates.saveUpdateInformation(responseToApply);

The reason doesClientNeedToBeUpdated returns true is because the lastUpdateIDAppliedToClient is smaller than the previousUpdateID response from CloseAccount.

const lastUpdateIDFromClient = clientLastUpdateID || lastUpdateIDAppliedToClient;
// If we don't have any value in lastUpdateIDFromClient, this is the first time we're receiving anything, so we need to do a last reconnectApp
if (!lastUpdateIDFromClient) {
return true;
}
return lastUpdateIDFromClient < previousUpdateID;

You can see that previousUpdateID is the lastUpdateID of the previous request.
image

But for the CloseAccount response, the previousUpdateID is bigger than the previous request lastUpdateID, so the app detected there is missing onyx data.
image

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

Fix it on the BE so the correct previousUpdateID is returned or if we want to fix this on the FE, we can add CloseAccount request to the requestsToIgnoreLastUpdateID list because we don't care if there is missing data when closing an account.

// If we're executing any of these requests, we don't need to trigger our OnyxUpdates flow to update the current data even if our current value is out of
// date because all these requests are updating the app to the most current state.
const requestsToIgnoreLastUpdateID: string[] = [WRITE_COMMANDS.OPEN_APP, SIDE_EFFECT_REQUEST_COMMANDS.RECONNECT_APP, SIDE_EFFECT_REQUEST_COMMANDS.GET_MISSING_ONYX_MESSAGES];

@isabelastisser isabelastisser added External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Jun 22, 2024
Copy link

melvin-bot bot commented Jun 22, 2024

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

@melvin-bot melvin-bot bot changed the title Close account - Unable to close unverified account [$250] Close account - Unable to close unverified account Jun 22, 2024
Copy link

melvin-bot bot commented Jun 22, 2024

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

@isabelastisser isabelastisser moved this to Release 1: Spring 2024 (May) in [#whatsnext] #wave-collect Jun 22, 2024
@isabelastisser
Copy link
Contributor

@mkhutornyi please review the proposals above when you have a chance. Thanks!

@jasham
Copy link

jasham commented Jun 22, 2024

Is this bug is still open or assigned to someone else ?

Copy link

melvin-bot bot commented Jun 22, 2024

📣 @jasham! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@jasham
Copy link

jasham commented Jun 22, 2024

Contributor details
Your Expensify account email: jasham009@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/jasham4ryou

Copy link

melvin-bot bot commented Jun 22, 2024

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@jasham
Copy link

jasham commented Jun 22, 2024

Is this bug is still open or assigned to someone else ?

@isabelastisser
Copy link
Contributor

@mkhutornyi, please review the proposals above!

@jasham, this is still open.

@melvin-bot melvin-bot bot added the Overdue label Jun 24, 2024
@isabelastisser
Copy link
Contributor

@mkhutornyi I DM'd you for visibility. Thanks!

@mkhutornyi
Copy link
Contributor

reviewing

@mkhutornyi
Copy link
Contributor

Pulling engineer for review since it's possible to fix in BE
🎀👀🎀

Copy link

melvin-bot bot commented Jun 25, 2024

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

Copy link

melvin-bot bot commented Jul 18, 2024

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 18, 2024
@isabelastisser
Copy link
Contributor

I will be OOO tomorrow and next week, so I am reassigning this until I return on July 29. Thanks, @kevinksullivan!

Status: Waiting for PR to merge.

@isabelastisser isabelastisser self-assigned this Jul 18, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jul 25, 2024
@melvin-bot melvin-bot bot changed the title [$250] Close account - Unable to close unverified account [HOLD for payment 2024-08-01] [$250] Close account - Unable to close unverified account Jul 25, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 25, 2024
Copy link

melvin-bot bot commented Jul 25, 2024

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

Copy link

melvin-bot bot commented Jul 25, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.11-5 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-08-01. 🎊

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

Copy link

melvin-bot bot commented Jul 25, 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:

  • [@mkhutornyi] The PR that introduced the bug has been identified. Link to the PR:
  • [@mkhutornyi] 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:
  • [@mkhutornyi] 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:
  • [@mkhutornyi] Determine if we should create a regression test for this bug.
  • [@mkhutornyi] 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.
  • [@kevinksullivan / @isabelastisser] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@isabelastisser
Copy link
Contributor

I'm back and taking this back! Thanks, @kevinksullivan!

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 31, 2024
@isabelastisser
Copy link
Contributor

Hey @mkhutornyi, please complete the BZ list above. Thanks!

@bernhardoj
Copy link
Contributor

Requested in ND.

@isabelastisser
Copy link
Contributor

Payment summary:

@bernhardoj requires payment through NewDot Manual Requests $250 / Contributor PENDING
@mkhutornyi requires payment automatic offer $250 (Reviewer) C+ PAID

@isabelastisser
Copy link
Contributor

@mkhutornyi, please complete the BZ list. I will DM you for visibility. Thanks!

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@mkhutornyi
Copy link
Contributor

The root cause was in backend. No offending PR in frontend.

Regression test:
https://expensify.testrail.io/index.php?/tests/view/4652683

@isabelastisser
Copy link
Contributor

All set! Closing.

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
No open projects
Status: Done
Development

No branches or pull requests

10 participants