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

[$250] LHN - After creating split expense and switching to another chat, LHN displays it as unread #52194

Closed
2 of 8 tasks
lanitochka17 opened this issue Nov 7, 2024 · 23 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 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

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 7, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.59-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Create a workspace and go to the workspace chat
  3. Split an expense
  4. Observe that half of the split expense appears below it
  5. Go to another chat

Expected Result:

The chat report in the LHN should not appear in bold, as the split expense has already been viewed

Actual Result:

The chat report in the LHN appears in bold, even though the split expense was seen

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6657723_1730992294464.1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021856693414198783158
  • Upwork Job ID: 1856693414198783158
  • Last Price Increase: 2024-12-04
Issue OwnerCurrent Issue Owner: @rayane-djouah
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 7, 2024
Copy link

melvin-bot bot commented Nov 7, 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.

@melvin-bot melvin-bot bot added the Overdue label Nov 11, 2024
Copy link

melvin-bot bot commented Nov 13, 2024

@JmillsExpensify Eep! 4 days overdue now. Issues have feelings too...

@JmillsExpensify
Copy link

While this is not a common flow, we have lots of issues with reports you just created showing unread in the LHN, so I'm going to open this up to the community to see if we have any creative solutions.

@melvin-bot melvin-bot bot removed the Overdue label Nov 13, 2024
@JmillsExpensify JmillsExpensify added External Added to denote the issue can be worked on by a contributor Overdue labels Nov 13, 2024
@melvin-bot melvin-bot bot changed the title LHN - After creating split expense and switching to another chat, LHN displays it as unread [$250] LHN - After creating split expense and switching to another chat, LHN displays it as unread Nov 13, 2024
Copy link

melvin-bot bot commented Nov 13, 2024

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

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

melvin-bot bot commented Nov 13, 2024

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

Copy link

melvin-bot bot commented Nov 19, 2024

@JmillsExpensify, @rayane-djouah Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot added the Overdue label Nov 19, 2024
@rayane-djouah
Copy link
Contributor

Waiting on proposals

@melvin-bot melvin-bot bot removed the Overdue label Nov 19, 2024
Copy link

melvin-bot bot commented Nov 20, 2024

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

Copy link

melvin-bot bot commented Nov 21, 2024

@JmillsExpensify @rayane-djouah 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!

@ugogiordano
Copy link
Contributor

ugogiordano commented Nov 21, 2024

Proposal

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

After creating a split expense and then switching to another chat, the chat in the LHN is displayed as unread.

What is the root cause of that problem?

The issue arises because the report is flagged as requiring attention from the user.

This is due to the requiresAttentionFromCurrentUser function returning true—indicating that the report contains a child expense still awaiting action from the current user.

const shouldShowGreenDotIndicator = !hasBrickError && ReportUtils.requiresAttentionFromCurrentUser(optionItem, optionItem.parentReportAction);

App/src/libs/ReportUtils.ts

Lines 2822 to 2824 in e04d145

function requiresAttentionFromCurrentUser(optionOrReport: OnyxEntry<Report> | OptionData, parentReportAction?: OnyxEntry<ReportAction>) {
return !!getReasonAndReportActionThatRequiresAttention(optionOrReport, parentReportAction);
}

Specifically, the getReasonAndReportActionThatRequiresAttention function returns a non-empty ReasonAndReportActionThatRequiresAttention object, which signals that there is an unresolved action (such as a pending expense) requiring the user's attention.

App/src/libs/ReportUtils.ts

Lines 2740 to 2743 in e04d145

type ReasonAndReportActionThatRequiresAttention = {
reason: ValueOf<typeof CONST.REQUIRES_ATTENTION_REASONS>;
reportAction?: OnyxEntry<ReportAction>;
};

This happens because the report’s hasOutstandingChildRequest is true, meaning the report has a child expense that is still pending action from the user. As a result, the condition evaluates to true, triggering the attention-required status, which ultimately causes the report to appear as unread in the LHN.

App/src/libs/ReportUtils.ts

Lines 2782 to 2788 in e04d145

// Has a child report that is awaiting action (e.g. approve, pay, add bank account) from current user
if (optionOrReport.hasOutstandingChildRequest) {
return {
reason: CONST.REQUIRES_ATTENTION_REASONS.HAS_CHILD_REPORT_AWAITING_ACTION,
reportAction: IOU.getIOUReportActionToApproveOrPay(optionOrReport, optionOrReport.reportID),
};
}

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

To fix this, when the report has an hasOutstandingChildRequest, we can add a check to see if the isUnread flag is false, like in the following snippet:

    // Has a child report that is awaiting action (e.g. approve, pay, add bank account) from current user
    if (optionOrReport.hasOutstandingChildRequest && !!('isUnread' in optionOrReport && optionOrReport.isUnread)) {
        return {
            reason: CONST.REQUIRES_ATTENTION_REASONS.HAS_CHILD_REPORT_AWAITING_ACTION,
            reportAction: IOU.getIOUReportActionToApproveOrPay(optionOrReport, optionOrReport.reportID),
        };
    }

This ensures that the unread icon is not displayed if the user has already read the chat, even when there’s an outstanding expense awaiting action.

Screen.Recording.2024-11-22.at.00.40.24.mp4

What alternative solutions did you explore? (Optional)

None

@melvin-bot melvin-bot bot added the Overdue label Nov 21, 2024
@rayane-djouah
Copy link
Contributor

Reviewing

@melvin-bot melvin-bot bot removed the Overdue label Nov 22, 2024
Copy link

melvin-bot bot commented Nov 26, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Nov 26, 2024
@rayane-djouah
Copy link
Contributor

Other GHs have been a priority; I'll work on the proposal review soon.

@melvin-bot melvin-bot bot removed the Overdue label Nov 26, 2024
Copy link

melvin-bot bot commented Nov 27, 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. (First week)

@melvin-bot melvin-bot bot added the Overdue label Nov 29, 2024
@muttmuure muttmuure moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Nov 29, 2024
@rayane-djouah
Copy link
Contributor

I'm not able to reproduce the issue. @ugogiordano, can you still reproduce it?

Screen.Recording.2024-11-29.at.2.54.59.PM.mov

@melvin-bot melvin-bot bot removed the Overdue label Nov 29, 2024
@ugogiordano
Copy link
Contributor

ugogiordano commented Nov 29, 2024

@rayane-djouah I can no longer see the bold text, but the green dot is still present, even in your video. From what I understand, both the bold text and the green dot (along with the '1' on the tab indicating an unread message) should disappear once the chat has been read.

@rayane-djouah
Copy link
Contributor

I can no longer see the bold text, but the green dot is still present, even in your video. From what I understand, both the bold text and the green dot should disappear once the chat has been read.

I believe the presence of the green dot is designed to indicate when there's a pending action required from the user, such as a payment action in this scenario.

(along with the '1' on the tab indicating an unread message)

The '1' on the tab in my video indicates an unread message in the concierge chat rather than the workspace report.


It appears that the issue with the bold text has been fixed.
cc @JmillsExpensify

@ugogiordano
Copy link
Contributor

ugogiordano commented Dec 2, 2024

I can no longer see the bold text, but the green dot is still present, even in your video. From what I understand, both the bold text and the green dot should disappear once the chat has been read.

I believe the presence of the green dot is designed to indicate when there's a pending action required from the user, such as a payment action in this scenario.

So, I don’t see this issue anymore if the green dot is designed to stay there even after you have read the message.

(along with the '1' on the tab indicating an unread message)

The '1' on the tab in my video indicates an unread message in the concierge chat rather than the workspace report.

I didn't see the bold text for the concierge chat, so I was thinking it might be something else.

Copy link

melvin-bot bot commented Dec 4, 2024

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

Copy link

melvin-bot bot commented Dec 5, 2024

@JmillsExpensify @rayane-djouah this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@melvin-bot melvin-bot bot added the Overdue label Dec 5, 2024
@rayane-djouah
Copy link
Contributor

I think we can close this since it's not reproducible anymore

@melvin-bot melvin-bot bot removed the Overdue label Dec 5, 2024
@JmillsExpensify
Copy link

Agreed, closing.

@github-project-automation github-project-automation bot moved this from Bugs and Follow Up Issues to Done in [#whatsnext] #expense Dec 5, 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. Daily KSv2 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
Projects
Status: Done
Development

No branches or pull requests

5 participants