-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD for Payment 2024-08-22][$250] Chat - Message marker disappears when the 2nd user deletes the first message #41935
Comments
Triggered auto assignment to @adelekennedy ( |
@adelekennedy 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 |
We think that this bug might be related to #vip-vsp |
still can't reproduce but I think this is due to site slowness |
aha - finally able to reproduce on chrome |
Job added to Upwork: https://www.upwork.com/jobs/~01074a670eb87f437f |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Chat - Message marker disappears when the 2nd user deletes the first message What is the root cause of that problem?When a message is deleted, the Since the user is inside the report, at this point the What changes do you think we should make in order to solve the problem?Thanks to the suggestion here, I've investigated and it seems we can fix this by storing the
I've tested and it's working well. What alternative solutions did you explore? (Optional)A thing to ponder: we could explore making |
@allroundexperts, @adelekennedy Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@allroundexperts one proposal to review above |
On it! |
ProposalPlease re-state the problem that we are trying to solve in this issue.Unread message marker disappears when the other user delete first marked unread message of the current user. What is the root cause of that problem?When other user delete a message,
But because of the deleted report action the report action will not be include in sortedVisibleReportActions, the marker would not be found: App/src/pages/home/report/ReportActionsList.tsx Lines 492 to 494 in a5bd1f2
What changes do you think we should make in order to solve the problem?We could add useRef to store next report action created time of current marked report action, for example Then below this line:
We set the ref: if (shouldDisplay) {
currentUnreadMarkerCreatedTime.current = index > 0 ? sortedVisibleReportActions[index - 1].created : null;
} Then above this line , we check whether the currentUnreadMarker exist in sortedVisibleReportActions and change the currentUnreadMarker if it is not exist. The code could be: if (currentUnreadMarker) {
const isCurrentMarkerReportActionExist = sortedVisibleReportActions?.findIndex((reportAction) => {
return reportAction.reportActionID === currentUnreadMarker;
});
if (isCurrentMarkerReportActionExist < 0) {
const markeredAction = sortedVisibleReportActions.findLast((action) => new Date(action.created) >= new Date(currentUnreadMarkerCreatedTime.current));
currentUnreadMarkerCreatedTime.current = markeredAction?.created;
setCurrentUnreadMarker(markeredAction.reportActionID);
return;
}
} else {
currentUnreadMarkerCreatedTime.current = null;
} If user can delete multiple message at once we could store the nextMessagesIds list instead of exactly one nextMessageId. Then search inside this list which message isn't deleted and setCurrentMarker to the message. The code could be:Set the ref:if (shouldDisplay) {
reportActionIdsNextToCurrentMarker.current =
sortedVisibleReportActions.slice(0, index).map((item) => {
return item.reportActionID
});
} and set marker: if (currentUnreadMarker) {
const isReportActionIdExist = (reportActionID) => {
return sortedVisibleReportActions?.find((item) => {
return reportActionID === item.reportActionID;
});
}
if (!isReportActionIdExist(currentUnreadMarker)) {
const oldestUnreadId = reportActionIdsNextToCurrentMarker.current?.findLast((id) => {
return isReportActionIdExist(id);
})
setCurrentUnreadMarker(oldestUnreadId ?? null);
return;
}
} else {
reportActionIdsNextToCurrentMarker.current = null;
} Result:macos-web-d.mp4 |
@tsa321 FYI your proposal won't fix this because the user could delete multiple report actions at once (ie. the action with the marker and the next one). In this case your That's why we need to find "the first action after the marker that's still available" as suggested in my proposal |
@dominictb How to delete multiple message at once? I can only delete one message at a time? I have updated my proposal to address the multiple deleted message at once. |
@allroundexperts will review the proposals above (chill out Melvin) |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@tsa321 Then this is same idea as my proposal, except that I don't define a new list but use the existing Let's wait for @allroundexperts to chime in. |
@arosiclair following up on your comment here:#44856 (comment) Shall we proceed the payment here (half the original bounty due to regression)? Thank you! |
Per my last comment on the PR, I'm going to take this internal. I'll try taking the approach I outlined on this other issue. |
Unfortunately there will be no payment since your original PR had a regression and was reverted and we did not accept your follow up PR (so ultimately there was nothing delivered). |
@arosiclair apology to ask. I see there's some inconsistency here. I have another issue with the same problem (original PR is reverted, following PR is declined), but based on this comment #41197 (comment) there should be payment for both C and C+? |
I believe they just made an exception in that case it's not a rule. I'll ask internally if we should do that again. |
@dominictb this issue is different than #41197 (comment) because we gave you another chance to submit an acceptable PR. Since the follow up PR was overly complex and deviated from their proposal, @arosiclair chose to take this internal. If the PR that ends up fixing the bug contains code from your followup PR, then you might be due compensation. We can address that once the PR hits production. Thx |
Draft is done I just need to complete the checklist and post the PR |
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. |
^ this regression got fixed in #47393, but the "fix" is really just a partial revert. So I still have to go back and clean it up. |
I reviewed the PR here as C+. |
payment due today! I think the only payment due here is for @ikevin127 for reviewing the PR, I've asked internally about any other additional payments. Payments Due
Upwork offer is here. |
@adelekennedy Offer accepted, thank you! |
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.72-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/4550091
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team
Action Performed:
Precondition: User A in main testing device, user B in secondary device
Expected Result:
New message marker to change place to the 2nd new message sent
Actual Result:
New message marker disappears
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6476074_1715268284452.Screen_Recording_2024-05-09_at_4.56.40_PM.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @arosiclairThe text was updated successfully, but these errors were encountered: