-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Due payment 2024-10-03][$250] Thread - Unread marker not displayed when opening thread with unread comments #47817
Comments
Triggered auto assignment to @kadiealexander ( |
@kadiealexander 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 |
Edited by proposal-police: This proposal was edited at 2024-08-22 04:54:49 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.The unread marker doesn't show when manually marked as unread and reopen the report. This happens to all report, not limited to thread. What is the root cause of that problem?The logic to display the unread marker checks whether the message is from the current user or not. App/src/pages/home/report/ReportActionsList.tsx Lines 225 to 239 in ad7c1d5
If it's from the current user, we won't show the unread marker, but only if the message is not marked manually (
When we mark it as unread manually, we set the state to the current date. App/src/pages/home/report/ReportActionsList.tsx Lines 256 to 258 in ad7c1d5
But when we switch the report or close and reopen it, the new report is mounted, so the state is reset. What changes do you think we should make in order to solve the problem?We need to store the mark manually state outside the component lifecycle. (OR using Onyx so it's persisted even when closing/refreshing the app) App/src/pages/home/report/ReportActionsList.tsx Lines 135 to 136 in ad7c1d5
Then, initialize the state with the cached value.
Next, we create a function to update the state and cache.
Last, we need to update the clear code here to clear the cache only. App/src/pages/home/report/ReportActionsList.tsx Lines 214 to 219 in ad7c1d5
Note: the above solution changes the type from Date to boolean |
Job added to Upwork: https://www.upwork.com/jobs/~0166496cbdb268ee61 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
@mollfpr please review the proposal above! |
ProposalPlease re-state the problem that we are trying to solve in this issue.The unread marker does not show when the user marks unread a message that they themselves have sent What is the root cause of that problem?The handling of the unread marker depends on the state of messageManuallyMarkedUnread which is lost when the user leaves the screen due to the component itself getting destroyed. What changes do you think we should make in order to solve the problem?When the message is marked as unread a BE action is triggered that updates the Onyx state appropriately. We can rely on that to display the marker line instead of the component state. const shouldDisplayNewMarker = (reportAction: OnyxTypes.ReportAction, index: number): boolean => {
const nextMessage = sortedVisibleReportActions[index + 1];
const isCurrentMessageUnread = isMessageUnread(reportAction, unreadMarkerTime);
const isNextMessageRead = !nextMessage || !isMessageUnread(nextMessage, unreadMarkerTime);
const shouldDisplay = isCurrentMessageUnread && isNextMessageRead && !ReportActionsUtils.shouldHideNewMarker(reportAction);
const isWithinVisibleThreshold = scrollingVerticalOffset.current < MSG_VISIBLE_THRESHOLD ? reportAction.created < (userActiveSince.current ?? '') : true;
return shouldDisplay && isWithinVisibleThreshold;
}; Along with it we also need to remove What alternative solutions did you explore? (Optional) |
@mollfpr, @kadiealexander 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? 💸 |
Sorry for the delay! Reviewing 👀 |
@mollfpr @kadiealexander 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! |
@mollfpr, @kadiealexander Whoops! This issue is 2 days overdue. Let's get this updated quick! |
I am still able to reproduce the issue. I agree with the RCA in both proposals but @bernhardoj did a great job elaborating on the root cause. I onboard with @bernhardoj solution and I think we don't need to use onyx to accommodate our need here. 🎀 👀 🎀 C+ reviewed! |
Triggered auto assignment to @neil-marcellini, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@mollfpr Wouldn't it be better to rely on the backend information instead of a state in the local storage so that the information is consistent across different devices? If I as a user mark unread a message in my mobile app I would expect that to show as unread if I open expensify in the browser as well. |
📣 @klajdipaja You have been assigned to this job! |
Ok interesting. Would you like to fix that in your PR for this issue, or do you think it would be best to keep separate? We should probably do that to keep the PRs small and focused, unless the solution is a small change. If you plan to keep it separate please report the bug in #expensify-bugs and tag me. |
@neil-marcellini I will work on the PR on Monday. |
…ndling of the unread marker so that we rely on the BE information about the last unread action
@neil-marcellini Sorry for the delay in creating the PR. It took me more than I thought it would to revive my old MacOs environment for the iOS testing. |
Yeah please add me for review I'd like to take a look.
I'm pretty sure this is not a bug. If a user has the report open and is scrolled near the bottom (the scroll view is below the threshold - |
I am wondering if the process for hiring on upwork has failed or maybe it has changed because the job has not been assigned to me on UpWork as should be based on this description:
|
…not_displayed_when_opening_thread_with_unread_comments [GH-47817]- remove messageManuallyMarkedUnread and manual handling of…
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Payouts due:
Upwork job is here. @neil-marcellini is this a regression? |
@kadiealexander I have accepted the Upwork offer but still has not received the payment. Can you let me know if there was an issue or when I can expect the payment to be made? |
@klajdipaja just confirming from @neil-marcellini whether there was a regression, and then we'll issue payment. Sorry for the delay! |
@kadiealexander Wow yes this one was a bit tricky. There were some regressions and the PR to fix this issue was mentioned, and maybe revealed some other issues, but it was not reverted so I think we can say that it did not directly cause any regressions. I think it's best explained in this comment. Let's pay the full amount. We can discuss more if anyone passionately disagrees. |
Sounds great to me, thanks @neil-marcellini! |
@mollfpr the only steps left are this checklist :) |
I couldn't determined which PR causing the issue.
I think the regression step is enough.
Mark unread user messages
Unread messages in the thread
Unread messages between devices
|
$250 approved for @mollfpr |
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: 9.0.23-0
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/4882295
Email or phone of affected tester (no customers):
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
The new message marker is displayed
Actual Result:
The new message marker is not displayed
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6578545_1724265464850.video_2024-08-21_14-36-03.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @kadiealexanderThe text was updated successfully, but these errors were encountered: