Skip to content

[HOLD for payment 2024-10-14] [$250] Expense - Main chat with RBR is not removed after dismissing error from expense report #46662

Closed

Description

@lanitochka17

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

Activity

  1. added
    Daily
    Bug
    on Aug 1, 2024
  2. melvin-bot commented on Aug 1, 2024

    @melvin-bot

    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.

  3. lanitochka17 commented on Aug 1, 2024

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

  4. lanitochka17 commented on Aug 1, 2024

    @lanitochka17
    Author

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

  5. bernhardoj commented on Aug 1, 2024

    @bernhardoj
    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);
    }

  6. melvin-bot commented on Aug 6, 2024

    @melvin-bot

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

  7. added
    External
    on Aug 7, 2024
  8. 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[/+] on Aug 7, 2024
  9. melvin-bot commented on Aug 7, 2024

    @melvin-bot
  10. added
    Help Wanted
    on Aug 7, 2024
  11. 61 remaining items

  12. melvin-bot commented on Oct 14, 2024

    @melvin-bot

    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
  13. bernhardoj commented on Oct 15, 2024

    @bernhardoj
    Contributor

    Requested in ND.

  14. JmillsExpensify commented on Oct 15, 2024

    @JmillsExpensify
    Contributor

    Payment summary above is correct.

  15. JmillsExpensify commented on Oct 15, 2024

    @JmillsExpensify
    Contributor

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

  16. trjExpensify commented on Oct 15, 2024

    @trjExpensify
    Contributor

    Confirming the payment summary is correct.

  17. melvin-bot commented on Oct 18, 2024

    @melvin-bot

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

  18. JmillsExpensify commented on Oct 21, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  19. JmillsExpensify commented on Oct 21, 2024

    @JmillsExpensify
    Contributor

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

  20. getusha commented on Oct 28, 2024

    @getusha
    Contributor

    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

  21. garrettmknight commented on Oct 29, 2024

    @garrettmknight
    Contributor

    $250 approved for @getusha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions