Skip to content

[Better Expense Report View] [$250] Chat bubble is always green in the expense preview when hold messages are read #62579

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

Open
5 of 8 tasks
nlemma opened this issue May 22, 2025 · 15 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@nlemma
Copy link

nlemma commented May 22, 2025

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.1.49-5
Reproducible in staging?: Yes
Reproducible in production?: Unable to check - New feature testing (Chat bubble is not on prod yet)
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: iPhone 15 Pro Max / iOS 18.4
App Component: Search

Action Performed:

  1. Launch Expensify app.
  2. Go to workspace chat.
  3. Submit an expense to the workspace chat.
  4. Long press on the expense preview > Hold.
  5. Enter reason and save it.
  6. Tap on the expense preview to mark the hold messages as read.
  7. Go to Reports.
  8. Tap bookmark button.
  9. Tap Expense Reports.
  10. Tap on the report.
  11. Tap app back button.

Expected Result:

Chat bubble will turn grey because the hold messages are already read in Step 6.

Actual Result:

Chat bubble is always green when the hold messages are already read in Step 6.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6839160_1747916098197.ScreenRecording_05-22-2025_20-07-42_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021925588134633455429
  • Upwork Job ID: 1925588134633455429
  • Last Price Increase: 2025-05-22
Issue OwnerCurrent Issue Owner: @ahmedGaber93
@nlemma nlemma added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 22, 2025
Copy link

melvin-bot bot commented May 22, 2025

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

Copy link

melvin-bot bot commented May 22, 2025

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

Copy link

melvin-bot bot commented May 22, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels May 22, 2025
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.

@nlemma
Copy link
Author

nlemma commented May 22, 2025

@lydiabarclay 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.

@arosiclair
Copy link
Contributor

Any progress on this @youssef-lr? I think this might be caused by #62286

@youssef-lr
Copy link
Contributor

Yeah, IMO this is minor and shouldn't block the deploy. What do you think about demoting this?

@youssef-lr
Copy link
Contributor

@sumo-slonik can you take a look please?

@arosiclair
Copy link
Contributor

Yeah let's demote 👍

@arosiclair arosiclair added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Engineering Hourly KSv2 labels May 22, 2025
@lydiabarclay lydiabarclay added the External Added to denote the issue can be worked on by a contributor label May 22, 2025
@melvin-bot melvin-bot bot changed the title Reports - Chat bubble is always green in the expense preview when hold messages are read [$250] Reports - Chat bubble is always green in the expense preview when hold messages are read May 22, 2025
Copy link

melvin-bot bot commented May 22, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 22, 2025
Copy link

melvin-bot bot commented May 22, 2025

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

@lydiabarclay
Copy link

@youssef-lr just checking - will @sumo-slonik be the Contributor for this issue? If so I'll assign

@nkdengineer
Copy link
Contributor

nkdengineer commented May 22, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-05-22 16:57:24 UTC.

Proposal

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

Chat bubble is always green when the hold messages are already read in Step 6.

What is the root cause of that problem?

n case the expense report has only 1 transaction, we will not have lastReadTime field in transactionReport => isReportUnread will be true here

const threadMessages = useMemo(
() => ({
count: (iouReportAction && iouReportAction?.childVisibleActionCount) ?? 0,
isUnread: isChatThread(transactionReport) && isReportUnread(transactionReport),
}),
[iouReportAction, transactionReport],
);

const isReportUnread = ({lastReadTime = '', lastVisibleActionCreated = '', lastMentionedTime = ''}: Report): boolean =>
lastReadTime < lastVisibleActionCreated || lastReadTime < (lastMentionedTime ?? '');

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

We should use lastReadTime from parent report instead

  1. Get parent report from transactionReport
    const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${transactionReport?.parentReportID}`, {
        canBeMissing: false,
    });
  1. Update isReportUnread function
   const isReportUnread = (lastReadTime = '', lastVisibleActionCreated = '', lastMentionedTime = ''): boolean =>
    {
        return lastReadTime < lastVisibleActionCreated || lastReadTime < (lastMentionedTime ?? '');
    };

const isReportUnread = ({lastReadTime = '', lastVisibleActionCreated = '', lastMentionedTime = ''}: Report): boolean =>
lastReadTime < lastVisibleActionCreated || lastReadTime < (lastMentionedTime ?? '');

  1. Add parentReport?.lastReadTime as fallback if we don't have transactionReport.lastReadTime
    isUnread: isChatThread(transactionReport) && isReportUnread(transactionReport.lastReadTime ?? parentReport?.lastReadTime, transactionReport.lastVisibleActionCreated, transactionReport.lastMentionedTime ?? ''),

const threadMessages = useMemo(
() => ({
count: (iouReportAction && iouReportAction?.childVisibleActionCount) ?? 0,
isUnread: isChatThread(transactionReport) && isReportUnread(transactionReport),
}),
[iouReportAction, transactionReport],
);

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

None

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@melvin-bot melvin-bot bot removed Help Wanted Apply this label when an issue is open to proposals by contributors labels May 22, 2025
@mountiny mountiny moved this to Second Cohort - HIGH in [#whatsnext] #migrate May 22, 2025
@mountiny
Copy link
Contributor

Assigned the PR author. @youssef-lr feel free to ressign the issue to me if you want but also feel free to keep it if you prefer.

@trjExpensify trjExpensify changed the title [$250] Reports - Chat bubble is always green in the expense preview when hold messages are read [Better Expense Report View] [$250] Chat bubble is always green in the expense preview when hold messages are read May 23, 2025
@trjExpensify trjExpensify moved this from Second Cohort - HIGH to Second Cohort - MEDIUM or LOW in [#whatsnext] #migrate May 23, 2025
@sumo-slonik
Copy link
Contributor

@youssef-lr just checking - will @sumo-slonik be the Contributor for this issue? If so I'll assign

Yes, I'm already working on it. Sorry for the delayed response — I was on vacation.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels May 28, 2025
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. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: Second Cohort - MEDIUM or LOW
Development

No branches or pull requests

9 participants