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

[LOW][$500] LHN – Chat in LHN in not bold if receive a second IOU from new user #37315

Closed
3 of 6 tasks
kbecciv opened this issue Feb 27, 2024 · 74 comments
Closed
3 of 6 tasks
Assignees
Labels
Engineering Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item. Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Feb 27, 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: v1.4.44-1
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/4343092
Issue reported by: Applause - Internal team

Action Performed:

Preconditions:
2 accounts are needed for this test, 1 logged in the main testing account and the second in a secondary device or browser.
Both accounts should NOT have a existing conversation.

  1. Go to https://staging.new.expensify.com/
  2. Secondary device - Send a request money to the account in the main testing device. Make sure they don't have a existing conversation
  3. Navigate to LHN
  4. Verify the conversation is marked as unread
  5. Navigate to the conversation
  6. Navigate back to LHN (mobile) or to another conversation (Web/Desktop)
  7. Verify the conversation is marked as read in LHN
  8. Secondary device - Send another money request to the same account
  9. Navigate to LHN

Expected Result:

The conversation is marked as unread after a new request was made

Actual Result:

The conversation is marked as read after a new request was made

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

Bug6394156_1709045670737.Screenrecorder-2024-02-27-11-24-06-158.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014f4d3cd1fd4967db
  • Upwork Job ID: 1762606281591746560
  • Last Price Increase: 2024-03-04
  • Automatic offers:
    • getusha | Reviewer | 0
    • FitseTLT | Contributor | 0
Issue OwnerCurrent Issue Owner: @mallenexpensify
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 27, 2024
Copy link

melvin-bot bot commented Feb 27, 2024

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

@kbecciv
Copy link
Author

kbecciv commented Feb 27, 2024

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

@mallenexpensify mallenexpensify added the Internal Requires API changes or must be handled by Expensify staff label Feb 27, 2024
Copy link

melvin-bot bot commented Feb 27, 2024

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

Copy link

melvin-bot bot commented Feb 27, 2024

Triggered auto assignment to Contributor Plus for review of internal employee PR - @getusha (Internal)

@mallenexpensify
Copy link
Contributor

@getusha do you think this can be external?
Adding to #vip-split project.

@melvin-bot melvin-bot bot added the Overdue label Mar 1, 2024
@getusha
Copy link
Contributor

getusha commented Mar 3, 2024

@mallenexpensify i think this can go external

cc @rlinoz looks like related to #36276

@melvin-bot melvin-bot bot removed the Overdue label Mar 3, 2024
@mallenexpensify mallenexpensify added External Added to denote the issue can be worked on by a contributor and removed Internal Requires API changes or must be handled by Expensify staff labels Mar 4, 2024
@melvin-bot melvin-bot bot changed the title LHN – Chat in LHN in not bold if receive a second IOU from new user [$500] LHN – Chat in LHN in not bold if receive a second IOU from new user Mar 4, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 4, 2024
Copy link

melvin-bot bot commented Mar 4, 2024

Current assignee @getusha is eligible for the External assigner, not assigning anyone new.

@FitseTLT
Copy link
Contributor

FitseTLT commented Mar 4, 2024

Proposal

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

LHN – Chat in LHN in not bold if receive a second IOU from new user

What is the root cause of that problem?

We compare lastReadTime with lastVisibileActionCreated to determine isUnread and report action is created for the first request and for the second request only the request will be included inside the preview report action and no visible action is created and also lastVisibleActionCreated is not updated and hence the report is no indicated as unread

App/src/libs/ReportUtils.ts

Lines 3834 to 3835 in 22cb01c

return lastReadTime < lastVisibleActionCreated || lastReadTime < lastMentionedTime;
}

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

We should create a new prop in report like lastRequestCreated and the BE should change that when a user create a request and from frontend we will add another || condition comparing it with lastReadTime

App/src/libs/ReportUtils.ts

Lines 3834 to 3835 in 22cb01c

return lastReadTime < lastVisibleActionCreated || lastReadTime < lastMentionedTime;
}

     return lastReadTime < lastVisibleActionCreated || lastReadTime < lastMentionedTime || lastReadTime < lastRequestCreated; 

What alternative solutions did you explore? (Optional)

We should add another logic on isUnread function that will check for the latest request made by the other user and if the created time is greater than the lastReadTime the report will be considered as Unread
We can first get the REPORTPREVIEW report action of the report and get the iou report linked to the report action (ReportActionsUtils.getIOUReportIDFromReportActionPreview ) and from there we will calculate the latest Request made by the other user - by checking for actorAccountID not equal to the current one. Compare the created timestamp with the current report's lastReadTime


Alternatively also we can also add a condition that whenever the iou report (under the current report) is Unread the current report also need to be unread that is we get iou Report from the preview report action using ReportActionsUtils.getIOUReportIDFromReportActionPreview and check if it is Unread

@arielgreen arielgreen changed the title [$500] LHN – Chat in LHN in not bold if receive a second IOU from new user [LOW] [Splits] [$500] LHN – Chat in LHN in not bold if receive a second IOU from new user Mar 4, 2024
@getusha
Copy link
Contributor

getusha commented Mar 5, 2024

and also lastVisibleActionCreated is not updated

@FitseTLT do you mind adding a bit more details in your RCA?

@FitseTLT
Copy link
Contributor

FitseTLT commented Mar 6, 2024

@getusha lastVisibleActionCreated is only updated when we create new visible report action and for the first time request a new REPORTPREVIEW type report action is created in the chat but for the second IOU request the user created in this issue the new request is included in the already existing REPORTPREVIEW type report action not new report action is created and hence lastVisibleActionCreated is not updated.

@getusha
Copy link
Contributor

getusha commented Mar 8, 2024

@FitseTLT's alternative solution sounds good to me.
🎀 👀 🎀 C+ Reviewed

Copy link

melvin-bot bot commented Mar 8, 2024

Triggered auto assignment to @yuwenmemon, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@mallenexpensify
Copy link
Contributor

@yuwenmemon 👀 on the proposal above when you have a min.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 11, 2024
Copy link

melvin-bot bot commented Mar 11, 2024

📣 @getusha 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Mar 11, 2024

📣 @FitseTLT 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@mallenexpensify
Copy link
Contributor

I'm confused here. When the initial request is made, it doesn't appear that the chat in LHN is bold

Image

and as part of these steps:

  1. Navigate to LHN
  2. Verify the conversation is marked as unread

I don't understand why the chat wouldn't be bold and unread if the person hasn't clicked on it. (which isn't the bug but the precursor to the bug (which says that the chat isn't bold the second time)

Here's what the testrail shows

Image

@FitseTLT @getusha are either of you able to fill me in on what I might be missing here. Ran into other weirdness while testing too.

@FitseTLT
Copy link
Contributor

@mallenexpensify as I explained it before this is not a bug but more of a new feature.

As the main user A if you create an expense for user B for user B the chat report will be unread because the report preview corresponding to the expense you created is assumed as a new message for the chat report but now if from USER B if you open the chat so that it will be read and then if you navigate to other chat and if you User A again create an expense to user B chat that expense will be added to the report preview and new message/report action is not created on the main chat with user B so User B will not see bold in this case on the chat with the main user. If we want to give an indicator for the user that new expenses have been added on existing reports that is a new feature request and it needs BE changes but was deemed to be not the priority for now. 👍

@mallenexpensify mallenexpensify added Weekly KSv2 NewFeature Something to build that is a new item. Internal Requires API changes or must be handled by Expensify staff and removed Monthly KSv2 Internal Requires API changes or must be handled by Expensify staff Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause labels Feb 12, 2025
Copy link

melvin-bot bot commented Feb 12, 2025

Current assignee @mallenexpensify is eligible for the NewFeature assigner, not assigning anyone new.

Copy link

melvin-bot bot commented Feb 12, 2025

⚠️ It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time ⚠️

Copy link

melvin-bot bot commented Feb 12, 2025

Triggered auto assignment to Design team member for new feature review - @dannymcclain (NewFeature)

@mallenexpensify
Copy link
Contributor

Thanks @FitseTLT , one more thing....
In the examples above, it's User A and User B. And, in the title it says Splits. Wouldn't this bug/new feature exist if I'm an employee (User A) and submit to my boss (User B)? I feel like this isn't just, only, for splitting.

@mallenexpensify
Copy link
Contributor

@dannymcclain please hold on reviewing til we have a better idea of next steps.

@dannymcclain
Copy link
Contributor

@mallenexpensify This feels more like a bug to me than a new feature? Shouldn't a new request always mark the chat as unread no matter what type of request?

@FitseTLT
Copy link
Contributor

@mallenexpensify This feels more like a bug to me than a new feature? Shouldn't a new request always mark the chat as unread no matter what type of request?

Nope @dannymcclain we only mark a chat as unread when new message/report action is created but we only create a new report preview report action for a new expense if there is no open expense/iou report in the chat. If there is a report that is not paid out then a new expense will be added to to that report and new message is only created for the iou/expense report not for the chat report.

I feel like this isn't just, only, for splitting.

@mallenexpensify Though the title says split the testing steps clearly show that it isn't so it is better to remove the Splits from the title 👍 This issue applies to both iou and expense reports.

@mallenexpensify mallenexpensify changed the title [LOW] [Splits] [$500] LHN – Chat in LHN in not bold if receive a second IOU from new user [LOW][$500] LHN – Chat in LHN in not bold if receive a second IOU from new user Feb 14, 2025
@mallenexpensify
Copy link
Contributor

Thanks @FitseTLT.
@getusha and @FitseTLT , what do you propose is the best next step here? There are a lot of comments here. Do we want to update the logic so that we're marking a chat as unread if this action?

new report preview report action for a new expense if there is no open expense/iou report in the chat.

@FitseTLT
Copy link
Contributor

I think the best next step is to start a slack convo. I will do it on Monday if you are ok with it 👍

@mallenexpensify
Copy link
Contributor

Please do @FitseTLT , post in #expensify-open-source and tag all assigned folks on this issue. Thx

@FitseTLT
Copy link
Contributor

@melvin-bot melvin-bot bot added the Overdue label Feb 24, 2025
@mallenexpensify
Copy link
Contributor

From convo in Slack, going to close.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item. Weekly KSv2
Projects
Status: Done
Development

No branches or pull requests

10 participants