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

IOU-Expense is not deleted in the expense details if there is a comment inside the expense #49052

Closed
2 of 6 tasks
IuliiaHerets opened this issue Sep 12, 2024 · 12 comments
Closed
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Hourly KSv2

Comments

@IuliiaHerets
Copy link

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: 9.0.33-1
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4952443
Email or phone of affected tester (no customers): testpayment935@gmail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. (User A) - Create two IOUs in a 1:1 conversation to user B
  2. (User B) - Create two IOUs in a 1:1 conversation to user A
  3. (User A) - Navigate to the IOU transaction thread of the expense submitted by user B
  4. (User A) - Send some messages to B's expense
  5. (User B) -Navigate to the IOU transaction thread of the expense submitted by user A
  6. (User B) - Send some messages to user A's expense
  7. (User B) - Go back and open your expense
  8. (User B) - Click on the header of your own expense
  9. (User B) - Click on Delete Expense

Expected Result:

The expense should be deleted.

Actual Result:

The expense is not deleted.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6600780_1726131268330.bandicam_2024-09-12_11-29-57-634.mp4

View all open jobs on GitHub

@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Sep 12, 2024
Copy link

melvin-bot bot commented Sep 12, 2024

Triggered auto assignment to @nkuoch (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Sep 12, 2024

Triggered auto assignment to @alexpensify (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 the Daily KSv2 label Sep 12, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Sep 12, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@nkdengineer
Copy link
Contributor

This comes from #48055

Proposal

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

The expense is not deleted.

What is the root cause of that problem?

For now, we only get the navigate-back URL in deleteTransaction function

} else {
const {urlToNavigateBack} = IOU.prepareToCleanUpMoneyRequest(iouTransactionID, requestParentReportAction, true);
navigateBackToAfterDelete.current = urlToNavigateBack;
}

Then here if navigateBackToAfterDelete .current is empty here, we only dismiss the modal without calling the delete expense API.

if (!navigateBackToAfterDelete.current) {
Navigation.dismissModal();
} else {

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

We should move the logic to delete the expense outside the if-else statement above

if (!navigateBackToAfterDelete.current) {
    Navigation.dismissModal();
} else {
    ReportUtils.navigateBackAfterDeleteTransaction(navigateBackToAfterDelete.current, true);
}

setTimeout(() => {
    if (ReportActionsUtils.isTrackExpenseAction(requestParentReportAction)) {
        return;
    };
    IOU.deleteMoneyRequest(iouTransactionID, requestParentReportAction, isSingleTransactionView);
}, CONST.ANIMATED_TRANSITION);

setTimeout(() => {
IOU.deleteMoneyRequest(iouTransactionID, requestParentReportAction, isSingleTransactionView);
}, CONST.ANIMATED_TRANSITION);
}
}}

Or we can also call the delete API here without setTimeout

if (!navigateBackToAfterDelete.current) {
    if (!ReportActionsUtils.isTrackExpenseAction(requestParentReportAction)) {
        IOU.deleteMoneyRequest(iouTransactionID, requestParentReportAction, isSingleTransactionView);
    }
    Navigation.dismissModal();
}

if (!navigateBackToAfterDelete.current) {
Navigation.dismissModal();
} else {

What alternative solutions did you explore? (Optional)

@luacmartins
Copy link
Contributor

@nkdengineer are you available to work on a fix now?

@nkdengineer
Copy link
Contributor

@luacmartins sure.

@luacmartins
Copy link
Contributor

cc @daledah @alitoshmatov since this is a regression from #48055

@luacmartins
Copy link
Contributor

@nkdengineer all yours

Copy link

melvin-bot bot commented Sep 12, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@Nodebrute
Copy link
Contributor

@luacmartins we have another regression from #48055

@luacmartins
Copy link
Contributor

Ok, we have potentially 3 regressions from that PR. I'm just gonna revert it instead of patching multiple things. @nkdengineer please pause working on your PR.

@luacmartins
Copy link
Contributor

This is fixed on staging. Closing.

@luacmartins luacmartins removed the DeployBlockerCash This issue or pull request should block deployment label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Hourly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants