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-14] [$250] Expense - Main chat with RBR is not removed after dismissing error from expense report #46662

Closed
6 tasks done
lanitochka17 opened this issue Aug 1, 2024 · 55 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 Aug 1, 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: 9.0.15-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/4783635
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • Device 1 and 2 are logged in with the same account
  1. Go to staging.new.expensify.com
  2. [Device 1] Go offline
  3. [Device 2] Go to FAB > Split expense > Manual
  4. [Device 2] Split a manual expense with two users
  5. [Device 1] While offline, split the same manual expense with the two same users from Step 4 (Same amount and same users)
  6. [Device 1] Go online
  7. [Device 1] Go to the main chat with RBR.
  8. [Device 1} Dimiss the error.
  9. {Device 1] Note that both the main chat and expense report with RBR are removed after dismissing the error.
  10. [Device 1] Click on the expense report with RBR (from another split participant) from LHN.
  11. [Device 1] Dismiss the error

Expected Result:

Both the main chat and expense report with RBR will be removed after dismissing the error from the expense report

Actual Result:

The main chat with RBR is not removed after dismissing the error from the expense report

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

Bug6557035_1722320798569.20240730_142159.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014accd823898117ec
  • Upwork Job ID: 1821194647122574091
  • Last Price Increase: 2024-08-28
Issue OwnerCurrent Issue Owner: @JmillsExpensify
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 1, 2024
Copy link

melvin-bot bot commented Aug 1, 2024

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

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

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@bernhardoj
Copy link
Contributor

Proposal

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

The main chat isn't removed when clearing the transaction from the expense report.

What is the root cause of that problem?

This was previously solved at #44923. Clearing the error will delete the main chat and all its child reports if the main chat fails to be created.

if ((isCreateChatErrored || !!report?.isOptimisticReport) && parentReportAction) {
const urlToNavigateBack = IOU.cleanUpMoneyRequest(transaction?.transactionID ?? linkedTransactionID, parentReportAction, true);
Navigation.goBack(urlToNavigateBack);
return;
}
if (transaction?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) {
if (chatReport?.reportID && ReportUtils.getAddWorkspaceRoomOrChatReportErrors(chatReport)) {
Report.navigateToConciergeChatAndDeleteReport(chatReport.reportID, true, true);
return;
}
if (Object.values(transaction?.errors ?? {})?.find((error) => ErrorUtils.isReceiptError(error))) {
deleteTransaction(parentReport, parentReportAction);
}
}

However, in #44142, they handle another case where the app will navigate back depending on whether to delete the transaction thread only or also the expense report (IOU.cleanUpMoneyRequest). If the expense report is deleted, then the user will be navigated back to the main chat. This works well to cover the case where the main chat is created. The problem is, that the logic for this takes priority over the logic explained in the first sentence above.

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

We should restructure the condition so if the main report/chat fails to be created, then we will perform the delete main report and its child logic, otherwise, use IOU.cleanUpMoneyRequest logic.

if (transaction?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) {
    if (chatReport?.reportID && ReportUtils.getAddWorkspaceRoomOrChatReportErrors(chatReport)) {
        Report.navigateToConciergeChatAndDeleteReport(chatReport.reportID, true, true);
        return;
    }
    if (parentReportAction) {
        const urlToNavigateBack = IOU.cleanUpMoneyRequest(transaction?.transactionID ?? linkedTransactionID, parentReportAction, true);
        Navigation.goBack(urlToNavigateBack);
        return;
    }
}

We won't need this logic anymore too. It was added in #43346 which is now handled by IOU.cleanUpMoneyRequest.

if (Object.values(transaction?.errors ?? {})?.find((error) => ErrorUtils.isReceiptError(error))) {
deleteTransaction(parentReport, parentReportAction);
}

@melvin-bot melvin-bot bot added the Overdue label Aug 5, 2024
Copy link

melvin-bot bot commented Aug 6, 2024

@JmillsExpensify Huh... This is 4 days overdue. Who can take care of this?

@JmillsExpensify JmillsExpensify added the External Added to denote the issue can be worked on by a contributor label Aug 7, 2024
@melvin-bot melvin-bot bot changed the title Expense - Main chat with RBR is not removed after dismissing error from expense report [$250] Expense - Main chat with RBR is not removed after dismissing error from expense report Aug 7, 2024
Copy link

melvin-bot bot commented Aug 7, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 7, 2024
Copy link

melvin-bot bot commented Aug 7, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Aug 7, 2024
@JmillsExpensify
Copy link

Added as wave-control polish and opened up for proposal reviews.

@getusha
Copy link
Contributor

getusha commented Aug 11, 2024

If the expense report is deleted, then the user will be navigated back to the main chat.

@bernhardoj, I don’t see how the PR you mentioned is responsible. The code that was added there isn’t navigating back without calling cleanUpMoneyRequest first, which is exactly what you’re proposing. or i am missing something...

@bernhardoj
Copy link
Contributor

Inside the cleanUpMoneyRequest logic (specifically the prepareToCleanUpMoneyRequest function), there is a condition on whether to delete the expense report or not.

App/src/libs/actions/IOU.ts

Lines 5525 to 5526 in e7fe622

const shouldDeleteIOUReport =
iouReportLastMessageText.length === 0 && !ReportActionsUtils.isDeletedParentAction(lastVisibleAction) && (!transactionThreadID || shouldDeleteTransactionThread);

If the condition is met, then the function will return a route to the chat report.

App/src/libs/actions/IOU.ts

Lines 5581 to 5583 in e7fe622

if (iouReport?.chatReportID && shouldDeleteIOUReport) {
reportIDToNavigateBack = iouReport.chatReportID;
}

Copy link

melvin-bot bot commented Aug 14, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Aug 14, 2024
Copy link

melvin-bot bot commented Aug 14, 2024

@JmillsExpensify, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@getusha
Copy link
Contributor

getusha commented Aug 15, 2024

Reviewing

@melvin-bot melvin-bot bot removed the Overdue label Aug 15, 2024
Copy link

melvin-bot bot commented Aug 15, 2024

@JmillsExpensify @getusha this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@getusha
Copy link
Contributor

getusha commented Aug 20, 2024

I am not able to reproduce this, no error appears after creating the same splits.

Screenshot 2024-08-20 at 12 22 45 in the afternoon

@bernhardoj
Copy link
Contributor

bernhardoj commented Aug 21, 2024

You can follow this step to repro it:

  1. [Device 1] Go offline and submit a money request to a new user
  2. [Device 2] Start a chat with the new user and send a message
  3. [Device 1] Go online
web.mp4

Copy link

melvin-bot bot commented Aug 21, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@mvtglobally
Copy link

Issue not reproducible during KI retests. (Second week)

@yuwenmemon
Copy link
Contributor

@getusha Bump on the review here!

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Sep 30, 2024
Copy link

melvin-bot bot commented Sep 30, 2024

This issue has not been updated in over 15 days. @JmillsExpensify, @yuwenmemon, @bernhardoj, @getusha eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot added the Monthly KSv2 label Sep 30, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Monthly KSv2 labels Oct 7, 2024
@melvin-bot melvin-bot bot changed the title [$250] Expense - Main chat with RBR is not removed after dismissing error from expense report [HOLD for payment 2024-10-14] [$250] Expense - Main chat with RBR is not removed after dismissing error from expense report Oct 7, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 7, 2024
Copy link

melvin-bot bot commented Oct 7, 2024

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

Copy link

melvin-bot bot commented Oct 7, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.45-4 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-14. 🎊

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

  • @bernhardoj requires payment through NewDot Manual Requests
  • @getusha requires payment through NewDot Manual Requests

Copy link

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

  • [@getusha] The PR that introduced the bug has been identified. Link to the PR:
  • [@getusha] 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:
  • [@getusha] 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:
  • [@getusha] Determine if we should create a regression test for this bug.
  • [@getusha] 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.
  • [@JmillsExpensify] 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 14, 2024
Copy link

melvin-bot bot commented Oct 14, 2024

Payment Summary

Upwork Job

BugZero Checklist (@JmillsExpensify)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1821194647122574091/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@bernhardoj
Copy link
Contributor

Requested in ND.

@JmillsExpensify
Copy link

Payment summary above is correct.

@JmillsExpensify
Copy link

@getusha do you mind filling out the BZ checklist before submitting via NewDot?

@trjExpensify
Copy link
Contributor

Confirming the payment summary is correct.

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

melvin-bot bot commented Oct 18, 2024

@JmillsExpensify, @yuwenmemon, @bernhardoj, @getusha Whoops! This issue is 2 days overdue. Let's get this updated quick!

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@melvin-bot melvin-bot bot removed the Overdue label Oct 21, 2024
@JmillsExpensify
Copy link

@getusha closing this one out, though don't forget to complete the checklist and we can approve payment in NewDot.

@getusha
Copy link
Contributor

getusha commented Oct 28, 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:

[@getusha] The PR that introduced the bug has been identified. Link to the PR: #44142
[@getusha] 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/44142/files#r1818504065
[@getusha] 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:
[@getusha] Determine if we should create a regression test for this bug. Seems like we already created a testrail for the same issue #43481 (comment)
[@getusha] 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

@garrettmknight
Copy link
Contributor

$250 approved for @getusha

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
Archived in project
Development

No branches or pull requests

8 participants