App
App copied to clipboard
HIGH: [UX Reliability] [$250] Chat is not marked as read when receiving a message being in the chat
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: 1.4.62-3 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: @iwiznia Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1711638025134599
Action Performed:
- Go to any chat
- Open another tab or not having the window on focus
- Receive a notification for a new message in the chat
- Click on the notification and land on the chat
- Chat should be marked since message is read
- Go to another chat
- Again open the chat where the message is received
Expected Result:
In step 4 or in step 6 LHN should be unbold as the message is read
Actual Result:
Still showing as unread, user has to click back to the chat as in step 7 to show as "read"
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- [ ] Android: Native
- [ ] Android: mWeb Chrome
- [ ] iOS: Native
- [ ] iOS: mWeb Safari
- [x] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/38435837/cc01a991-50f0-4fee-b112-477bb33c3c4e
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~018e5ebea78782ee33
- Upwork Job ID: 1778874424236658688
- Last Price Increase: 2024-04-26
Triggered auto assignment to @dylanexpensify (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.
Yep, could repro, though low value
Job added to Upwork: https://www.upwork.com/jobs/~018e5ebea78782ee33
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (External
)
though low value
I disagree, this is happening to me every day, many times a day. It makes the app look broken as it makes you have to click out and back in to mark as read.
What is the expected behaviour? Should we quickly mark it as read when the user switches to the tab? Then the user wouldn't be able to know that there are some new messages, and where the new messages start from. Maybe we can have some interval, like mark it as read after 4 seconds (just as an example).
Doesn't show notifications for me like in the video, do I need to activate something? trying to replicate the issue. @dylanexpensify
📣 @giorgi17! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
I disagree, this is happening to me every day, many times a day. It makes the app look broken as it makes you have to click out and back in to mark as read.
happy to move this higher then @iwiznia!
Doesn't show notifications for me like in the video, do I need to activate something? trying to replicate the issue. @dylanexpensify
@giorgi17 ah make sure your preferences allow for notifications from New Expensify!
What is the expected behaviour? Should we quickly mark it as read when the user switches to the tab? Then the user wouldn't be able to know that there are some new messages, and where the new messages start from. Maybe we can have some interval, like mark it as read after 4 seconds (just as an example).
@ShridharGoel simple - just if the user clicks on the notification and reads the chat, it's marked as read then and there (aka unbolds instantly when opening the chat).
simple - just if the user clicks on the notification and reads the chat, it's marked as read then and there (aka unbolds instantly when opening the chat).
@dylanexpensify And what about the "New" marker that we show above the unread messages?
@ShridharGoel that should disappear at the same rate it does for any new message! cc @Expensify/design not sure if we have a limit distinguished for this
I would think the New marker would stay in the chat as long as you are looking at the chat. This way if you do scroll up and down in the chat, you at least have a marker that shows you where the new messages start. If you navigate away and come back, then the new marker would disappear. Is that what you are asking Dylan?
Doesn't show notifications for me like in the video, do I need to activate something? trying to replicate the issue. @dylanexpensify
@giorgi17 ah make sure your preferences allow for notifications from New Expensify!
I did, but still couldn't see notifications, perhaps it's not reproducible on local. However, I've found similar issue, where receiving the message and opening It doesn't unbold the text, it's still seen as "unread". It only works after 1 minute or so. See the footage My diagnosis is that from frontend, the message creation time is sent correctly, but then the response has the time 1.5 minutes later, because of this, the logic is flawed. Read time is always 1.5 minute earlier if you quickly try to view the new message upon receiving it, you basically need to wait 2 minutes so you can then open the chat and it'll then pick that it's now read, so, for the first 2 minutes, this logic doesn't work. This is why I was trying to find the backend code, it's a huge project, could you tell me where I could see the backend code, or Is there one at all in this project. Maybe i could find the reason there for this time difference.
The same reason could be in the case of notification. Fixing this requires figuring out, why after sending the right message creation time, i receive the time from the database that is 1.5 minutes older.
You can see this difference in this pics:
This is what Is sent from frontend - lastVisibleActionCreated
.
This is what I got back:
About 1.5 minute difference.
This is the line where it's compared:
lastReadTime
is I believe created in frontend, but the lastVisibleActionCreated
is received from backend, which is incorrect by almost 2 minutes, so if chat opened in that timeline, in the first 2 minutes, it won't "unbold" the name and it'll see it as unread.
@abdulrahuman5196, @dylanexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@abdulrahuman5196, @dylanexpensify Still overdue 6 days?! Let's take care of this!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Yes, my proposal is satisfactory - https://github.com/Expensify/App/issues/40152#issuecomment-2056672875
Checking now
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Yes, my proposal is satisfactory - #40152 (comment)
@giorgi17 Kindly propose your root cause and solution as per the https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md
@FitseTLT I think we fixed this sometime back right? Or is it different?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Yes, my proposal is satisfactory - #40152 (comment)
@giorgi17 Kindly propose your root cause and solution as per the https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md
I did - here. What did I do incorrectly? My solution works, and I followed the correct structure for proposing solution.
@abdulrahuman5196 @dylanexpensify 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!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@abdulrahuman5196, @dylanexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
I'm seeing something different than what giorgi is seeing. When following the steps to reproduce, when i console log the optimisticReport from src/libs/actions/Report.ts:477 , and compare it's lastVisibleActionCreatedTime to that from the lastVisibleActionCreatedTime value inside the addComment POST response body, i see a difference in the order of milliseconds (2024-04-27 18:27:57.093 from the response body and 2024-04-27 18:27:56.685 from the optimistic report object for example ).
One thing I've noticed is that components that are getting report data from the onyx store via withOnyx are rendering with stale data when landing on a report from a browser notification.
The components DO have a render where they are rendering with the most up to date lastReadTime, but then they rerender with the previous/stale lastReadTime.
You can see this when you view the lastReadTime for a report in local storage, and then compare it to a value for a report the withOnyx HOC is returning.
Just for an arbitrary example, in localStorage I happen to have 2024-04-27 18:28:05.186 for the report i'm testing, but when i inspect the props LHNOptionsList is getting with react devtools I see 2024-04-27 18:27:04.873 , which is the previous / stale value for lastReadTime.
This is the first expensify issue I have looked at and I don't know enough about onyx or the report flow to diagnose a root cause.
📣 @robert-westenberger! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0121200855c9004c83
✅ Contributor details stored successfully. Thank you for contributing to Expensify!