Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.29k stars 2.73k forks source link

[$250] Reports w/ 404 are stuck in LHN #45551

Open m-natarajan opened 1 month ago

m-natarajan commented 1 month ago

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.8-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: @roryabraham Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1721060374459769

Action Performed:

  1. [Alice] Add someone to a room
  2. [Bob] (the room should show up in their LHN)
  3. [Alice] Remove Bob from the room
  4. [Bob] Click on the room

Expected Result:

You should see a Hmmm it's not here (404 error), then when you navigate away the report should disappear from the LHN.

Actual Result:

You see a Hmmm it's not here, but the report is stuck in your LHN with a red dot (RBR indicator), and can't be cleared.

Workaround:

unknown

Platforms:

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

Screenshots/Videos

image (26)

https://github.com/user-attachments/assets/5ffa4369-4240-4b89-bbb9-57e87bac6afe

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016fe03af3d662fd8f
  • Upwork Job ID: 1816184301014111029
  • Last Price Increase: 2024-09-04
Issue OwnerCurrent Issue Owner: @ikevin127
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @strepanier03 (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[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

@strepanier03 Still overdue 6 days?! Let's take care of this!

strepanier03 commented 1 month ago

Working on this now, sorry for the delay.

strepanier03 commented 1 month ago

What timing, I have a chat that follows this pattern in my LHN right now that showed up this morning 😂. There's no way to dismiss it and it's stuck with a RBR in my LHN all day so far.

strepanier03 commented 1 month ago

Mac/Chrome

image

Here's the Onyx Data for that chat:

{
    "chatType": "",
    "currency": "USD",
    "description": "",
    "hasOutstandingChildRequest": false,
    "hasOutstandingChildTask": false,
    "isCancelledIOU": false,
    "isOwnPolicyExpenseChat": false,
    "isPinned": false,
    "isWaitingOnBankAccount": false,
    "lastActionType": "CREATED",
    "lastActorAccountID": 17680685,
    "lastMessageHtml": "hi",
    "lastMessageText": "hi",
    "lastReadSequenceNumber": 0,
    "lastVisibleActionCreated": "2024-06-26 08:59:07.758",
    "lastVisibleActionLastModified": "2024-06-26 08:56:07.301",
    "managerID": 0,
    "nonReimbursableTotal": 0,
    "notificationPreference": "always",
    "oldPolicyName": "",
    "ownerAccountID": 0,
    "participants": {
        "2644835": {
            "hidden": false
        },
        "17680685": {
            "hidden": false
        }
    },
    "permissions": [
        "read",
        "write"
    ],
    "policyID": "_FAKE_",
    "reportID": "3860266512989981",
    "reportName": "Chat Report",
    "stateNum": 0,
    "statusNum": 0,
    "total": 0,
    "type": "chat",
    "unheldTotal": 0,
    "welcomeMessage": "",
    "writeCapability": "all",
    "isEdited": false,
    "errorFields": {
        "notFound": {
            "1720457339876689": "Report not found",
            "1720478844867650": "Report not found",
            "1721845816001669": "Report not found",
            "1721845828999863": "Report not found",
            "1721845837355611": "Report not found",
            "1721846910100562": "Report not found"
        }
    },
    "lastReadTime": "2024-07-08 22:47:30.782"
}
melvin-bot[bot] commented 1 month ago

Job added to Upwork: https://www.upwork.com/jobs/~016fe03af3d662fd8f

melvin-bot[bot] commented 1 month ago

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

nkdengineer commented 1 month ago

Proposal

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

You see a Hmmm it's not here, but the report is stuck in your LHN with a red dot (RBR indicator), and can't be cleared.

What is the root cause of that problem?

After the user is removed from the room, the report data is still present in Onyx and it has a not found error when the removed user clicks on the room again. That makes hasErrorsOtherThanFailedReceipt is true https://github.com/Expensify/App/blob/b0f810df06c3df866b7fdbed4959f8f1fef803ed/src/libs/SidebarUtils.ts#L123-L127

And then here we always put this report in LHN if hasErrorsOtherThanFailedReceipt is true https://github.com/Expensify/App/blob/b0f810df06c3df866b7fdbed4959f8f1fef803ed/src/libs/SidebarUtils.ts#L130-L136

So this report is always displayed in LHN

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

We should check if the report has not found an error we will not push this report here.

if (hasErrorsOtherThanFailedReceipt && !report?.errorFields?.notFound) {

https://github.com/Expensify/App/blob/b0f810df06c3df866b7fdbed4959f8f1fef803ed/src/libs/SidebarUtils.ts#L130-L136

Then when we go to shouldReportBeInOptionList check, it already has the check to return false if the report is not found https://github.com/Expensify/App/blob/b0f810df06c3df866b7fdbed4959f8f1fef803ed/src/libs/ReportUtils.ts#L5531-L5533

https://github.com/Expensify/App/blob/b0f810df06c3df866b7fdbed4959f8f1fef803ed/src/libs/ReportUtils.ts#L5373-L5375

What alternative solutions did you explore? (Optional)

ikevin127 commented 1 month ago

@strepanier03 @nkdengineer I cannot reproduce the issue, I followed the steps and the result on my side is:

Note: The room was freshly created when I attempted reproducing.

Here's a video of how it looks on my side:

Web: Chrome / Safari https://github.com/user-attachments/assets/bd25d9e8-41ac-4894-8f1c-5925056fb828

To me ^ this looks like the correct and expected behaviour, meaning: silently being removed, without any Not found page being shown or RBR errors.

If anyone has clear / more detailed steps as to how this can be consistently reproduced, please let me know so we can move forward with a fix.

Otherwise, I'd add the Needs Reproduction label and have a few other prople try reproducing this and if no dice then close as non-reproducible (probably BE pusher event related [not removing the data correctly from {Bob}]).

cc @roryabraham (since you reported this)

roryabraham commented 1 month ago

@strepanier03 are you still able to reproduce this?

nkdengineer commented 1 month ago

I can't reproduce it now. Yesterday, when the user was removed, the user didn't receive any pusher data so we can reproduce this bug. But now, the pusher data clears the report data and then this issue cannot be reproduced.

Screenshot 2024-07-26 at 13 13 23
melvin-bot[bot] commented 1 month ago

@strepanier03, @ikevin127 Whoops! This issue is 2 days overdue. Let's get this updated quick!

ikevin127 commented 1 month ago

Needs Reproduction

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

@strepanier03 @ikevin127 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!

MelvinBot commented 1 month ago

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

melvin-bot[bot] commented 1 month ago

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

ikevin127 commented 1 month ago

Needs Reproduction - callback on https://github.com/Expensify/App/issues/45551#issuecomment-2251615629 / https://github.com/Expensify/App/issues/45551#issuecomment-2252048407.

melvin-bot[bot] commented 1 month ago

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

ikevin127 commented 1 month ago

Needs Reproduction - callback on https://github.com/Expensify/App/issues/45551#issuecomment-2251615629 / https://github.com/Expensify/App/issues/45551#issuecomment-2252048407.

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 4 weeks ago

@strepanier03, @ikevin127 Whoops! This issue is 2 days overdue. Let's get this updated quick!

ikevin127 commented 3 weeks ago

Needs Reproduction - callback on https://github.com/Expensify/App/issues/45551#issuecomment-2251615629 / https://github.com/Expensify/App/issues/45551#issuecomment-2252048407.

melvin-bot[bot] commented 3 weeks ago

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

melvin-bot[bot] commented 3 weeks ago

@strepanier03 @ikevin127 this issue is now 4 weeks old, please consider:

Thanks!

melvin-bot[bot] commented 3 weeks ago

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

ikevin127 commented 3 weeks ago

Needs Reproduction - callback on https://github.com/Expensify/App/issues/45551#issuecomment-2251615629 / https://github.com/Expensify/App/issues/45551#issuecomment-2252048407.

melvin-bot[bot] commented 2 weeks ago

@strepanier03, @ikevin127 Huh... This is 4 days overdue. Who can take care of this?

ikevin127 commented 2 weeks ago

Needs Reproduction - callback on https://github.com/Expensify/App/issues/45551#issuecomment-2251615629 / https://github.com/Expensify/App/issues/45551#issuecomment-2252048407.

melvin-bot[bot] commented 2 weeks ago

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

melvin-bot[bot] commented 1 week ago

@strepanier03, @ikevin127 Huh... This is 4 days overdue. Who can take care of this?

ikevin127 commented 1 week ago

Needs Reproduction - callback on https://github.com/Expensify/App/issues/45551#issuecomment-2251615629 / https://github.com/Expensify/App/issues/45551#issuecomment-2252048407.

melvin-bot[bot] commented 1 week ago

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

melvin-bot[bot] commented 1 week ago

@strepanier03, @ikevin127 Whoops! This issue is 2 days overdue. Let's get this updated quick!

ikevin127 commented 1 week ago

Needs Reproduction - callback on https://github.com/Expensify/App/issues/45551#issuecomment-2251615629 / https://github.com/Expensify/App/issues/45551#issuecomment-2252048407.

melvin-bot[bot] commented 3 days ago

@strepanier03, @ikevin127 Whoops! This issue is 2 days overdue. Let's get this updated quick!

ikevin127 commented 3 days ago

Needs Reproduction - callback on https://github.com/Expensify/App/issues/45551#issuecomment-2251615629 / https://github.com/Expensify/App/issues/45551#issuecomment-2252048407.

melvin-bot[bot] commented 2 days ago

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