-
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
[$250] mWeb - chat-After deleting mark us unread msg, new green line shown in new msg sent. #47735
Comments
Triggered auto assignment to @alexpensify ( |
We think that this bug might be related to #vip-vsp |
@alexpensify 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 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Deleting the message that is manually marked as unread makes any new messages sent also become marked as unread. What is the root cause of that problem?The root cause of this problem is the
App/src/pages/home/report/ReportActionsList.tsx Lines 231 to 236 in 72a7593
What changes do you think we should make in order to solve the problem?Since there is already a callback that triggers when the user sends a new message, App/src/pages/home/report/ReportActionsList.tsx Lines 362 to 376 in 72a7593
we can just add an additional check into this callback to reset the messageManuallyMarkedUnread state if we're not displaying the new message marker (probably is also worth giving the callback a rename to reflect this change). I added in a const shouldDisplayNewMarkerRef = useRef(false) , which gets set in unreadMarkerReportActionID useMemo:App/src/pages/home/report/ReportActionsList.tsx Lines 241 to 247 in 72a7593
(gets set to false before the for loop, and gets set to true if shouldDisplayNewMarker ends up being true.Then, in the scrollToBottomForCurrentUserAction callback add in a check to setMessageManuallyMarkedUnread to 0 if shouldDisplayNewMarkerRef.current is false .
Before: Screen.Recording.2024-08-20.at.22.53.04.mp4After: Screen.Recording.2024-08-20.at.22.53.49.mp4 |
/## Proposal Please re-state the problem that we are trying to solve in this issue.What is the root cause of that problem?We are not updating unread marker time when the last unread report action deleted What changes do you think we should make in order to solve the problem?We can update unread marker time when some of the report actions deleted, we can add new condition to indicate some report action deleted add this condition: Change this code to: const mostRecentReportActionCreated = sortedVisibleReportActions[0]?.created ?? '';
const prevMostRecentReportActionCreated = usePrevious(mostRecentReportActionCreated);
useEffect(() => {
if (unreadMarkerReportActionID) {
return;
}
if (mostRecentReportActionCreated <= unreadMarkerTime && mostRecentReportActionCreated >= prevMostRecentReportActionCreated) {
return;
}
setUnreadMarkerTime(mostRecentReportActionCreated);
setMessageManuallyMarkedUnread(0); What alternative solutions did you explore? (Optional)N/A |
ProposalPlease re-state the problem that we are trying to solve in this issue.The unread line indicator shows again after deleting the unread message and add a message. What is the root cause of that problem?When we marked a message as unread, we set the App/src/pages/home/report/ReportActionsList.tsx Lines 255 to 259 in 685bb4c
which will trigger the recalculation of the unread report action ID. App/src/pages/home/report/ReportActionsList.tsx Lines 224 to 250 in 685bb4c
When we delete the message, the What changes do you think we should make in order to solve the problem?We need to update the App/src/pages/home/report/ReportActionsList.tsx Lines 277 to 291 in 685bb4c
We can expand this by covering both delete and add cases by removing this condition (or changing the condition to strictly equal so we won't call the set state if the value is the same). App/src/pages/home/report/ReportActionsList.tsx Lines 283 to 285 in 685bb4c
This way, if a report is read, adding a new message or deleting the last message will update the unread marker time to the latest report action. As a note, when we delete the last unread message, the |
I'll add this to my task list to test |
@alexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Job added to Upwork: https://www.upwork.com/jobs/~01fb6fb45334b2068a |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @c3024 ( |
@c3024, when you get a chance, please review the proposals and determine which one will fix this issue. Thanks! Heads up, I will be offline until Tuesday, September 3, 2024, and will not actively watch over this GitHub during that period.If anything urgent is needed here, please ask for help in the #expensify-open-source Slack Room-- thanks! |
@alexpensify, @c3024 Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Thank you all for your proposals. I think we should set The change in the App/src/pages/home/report/ReportActionsList.tsx Lines 283 to 285 in 685bb4c
is not appropriate because it was deliberately added here to minimize state changes. Both solutions suggested here and here fix the issue correctly and are somewhat equivalent because for a read report, the Since the solution by @bernhardoj appears simpler to me, I think we can go with his solution here of strictly equal comparison of 🎀 👀 🎀 C+ Reviewed |
Triggered auto assignment to @iwiznia, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @c3024 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
PR is ready cc: @c3024 |
Catching up from being OOO, I see the PR is waiting to go to production. |
Automation failed here. PR Deployed to production on 6-Sep. Should be on HOLD till 13-Sep or 14-Sep for payment. cc: @alexpensify |
Thank you for this summary and I've noted the payment date. |
Payouts due: 2024-09-12
Upwork job is here. |
Closing - I've completed the process in Upwork. |
Requested in ND. |
$250 approved for @bernhardoj |
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.22
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
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Mark as unread &delete a message, after that if we send a new message, new message green line must not be shown above
Actual Result:
Mark as unread &delete a message, after that if we send a new message, new message green line is shown above
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6577188_1724169473802.screenrecorder-2024-08-20-17-17-51-730.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: