Skip to content

[$500] LHN - Report is not marked as unread in LHN when the IOU is received #38186

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: 1.4.501
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): sustinov@applausemail.com
Issue reported by: Applause - Internal Team

Issue found when executing PR #35928

Action Performed:

Preconditions:
Set up an OldDot admin account, invite the employee and approver to the policy https://sites.google.com/applausemail.com/applause-expensifyproject/wiki-guides/newdot-categories?authuser=0

  1. Open https://staging.new.expensify.com/
  2. Log in with the account of the employee added to the policy
  3. Open https://staging.new.expensify.com/
    in incognito mode
  4. Log in to the policy approver account
  5. Under the approver account, go to the WS room.
  6. Under the employee account, create a manual request and send it to the WS room
  7. Click on the "Submit" button in the created IOU

Expected Result:

When an IOU is received, the Report in the LHN should be marked as unread

Actual Result:

Report is not marked as unread in LHN when the IOU is received

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

Bug6410215_1710188687689.Recording__1416.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013810a6929404cade
  • Upwork Job ID: 1769899997275127808
  • Last Price Increase: 2024-07-18

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 12, 2024
  2. melvin-bot commented on Mar 12, 2024

    @melvin-bot

    Triggered auto assignment to @MitchExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. lanitochka17 commented on Mar 12, 2024

    @lanitochka17
    Author

    @MitchExpensify 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. MitchExpensify commented on Mar 14, 2024

    @MitchExpensify
    Contributor

    @dylanexpensify you've been super close to message unread/read behavior - Should a new IOU show as unread? I think "yes", right?

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Mar 19, 2024
  6. melvin-bot commented on Mar 19, 2024

    @melvin-bot
  7. changed the title [-] LHN - Report is not marked as unread in LHN when the IOU is received[/-] [+][$500] LHN - Report is not marked as unread in LHN when the IOU is received[/+] on Mar 19, 2024
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 19, 2024
  9. melvin-bot commented on Mar 19, 2024

    @melvin-bot

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

  10. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 19, 2024
  11. 66 remaining items

  12. twisterdotcom commented on Jul 17, 2024

    @twisterdotcom
    Contributor

    @MitchExpensify #38778 is closed. Is there anything else this should be held on?

  13. MitchExpensify commented on Jul 17, 2024

    @MitchExpensify
    Contributor

    Ah closed yesterday, nice. No that's all that was holding this up

  14. changed the title [-][Hold on#38778] [$500] LHN - Report is not marked as unread in LHN when the IOU is received[/-] [+][$500] LHN - Report is not marked as unread in LHN when the IOU is received[/+] on Jul 18, 2024
  15. melvin-bot commented on Jul 18, 2024

    @melvin-bot

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

  16. twisterdotcom commented on Jul 22, 2024

    @twisterdotcom
    Contributor

    Okay, I see this is still a thing:

    38186.mp4
  17. twisterdotcom commented on Jul 22, 2024

    @twisterdotcom
    Contributor

    @kmbcook or @bernhardoj - do you fancy a go at a proposal for this now? @trjExpensify I'm correct in thinking that a new green dot request should be an unread comment right?

  18. bernhardoj commented on Jul 22, 2024

    @bernhardoj
    Contributor

    Proposal

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

    The chat item in LHN doesn't show as bold for the workspace admin/approver when there is an expense preview

    What is the root cause of that problem?

    #36950 changes the unread logic a bit by checking whether the report has a lastActorAccountID or not.

    // When the only message of a report is deleted lastVisibileActionCreated is not reset leading to wrongly
    // setting it Unread so we add additional condition here to avoid empty chat LHN from being bold.
    result.isUnread = ReportUtils.isUnread(report) && !!report.lastActorAccountID;

    But in case the last action is a report preview, the last actor account ID is 0.
    image

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

    First of all, we should revert #36950 as it doesn't fix the root cause of the issue. The issue that the PR is trying to fix is that when we delete the last message in a room from device A, the lastVisibleActionCreated property of the report isn't updated in device B, so the unread status stays true.

    return lastReadTime < lastVisibleActionCreated || lastReadTime < lastMentionedTime;

    It will be updated once the device B opens the room. So, the problem is in the pusher that doesn't send the update to device B. Instead of patching up the issue, we should fix the pusher.

    fyi, when we delete the last message, we set the lastVisibleActionCreated to empty optimistically, that's why the device A doesn't experience the issue. I think it should be set to the CREATED action created value, but I guess that's another topic to discuss

  19. bernhardoj commented on Jul 22, 2024

    @bernhardoj
    Contributor

    The issue is actually the same, but because the other issue is closed, I reposted my proposal here

  20. situchan commented on Jul 22, 2024

    @situchan
    Contributor

    @twisterdotcom I can take this back as C+ while @jjcoffee is OOO

  21. trjExpensify commented on Jul 22, 2024

    @trjExpensify
    Contributor

    @trjExpensify I'm correct in thinking that a new green dot request should be an unread comment right?

    Go from 1.30 in the video. You were in the chat when the IOU came through. So I wouldn't expect it to be unread in that case, would you?

    image
  22. twisterdotcom commented on Jul 23, 2024

    @twisterdotcom
    Contributor

    Ahhh good point. Okay, tested again and this is fixed:
    Arc 2024-07-23 12 25 19

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions