-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 2023-02-24] [$2000] Chat -If you mark a message as unread, then delete it -"New messages" button does not dissapear #14649
Comments
@NikkiWines is this something we will want to work on fixing internally? |
Hmm, yeah I'm not sure what the intended behavior is here to be honest. Not sure if we'd consider this part of the same issue (or an issue at all) but the line and banner seem to persist even if you don't delete the message and scroll past the message marked as unread. cc: @roryabraham tagging you cause slack history shows you've mentioned the unread indicator a couple of times Screen.Recording.2023-02-01.at.13.04.44.mov |
Trying my best to clarify the expected behavior here:
Does that make sense? |
So @NikkiWines what you've shown in this screenshot is expected. 👍🏼 |
Looking closer at the video in the OP, it looks like this is happening as expected:
Expected behavior: The report remains unread and the new message indicator appears on the next-oldest reportAction ✅ However, this is not happening as expected: Steps to reproduce:
Expected behavior
Actual behavior
|
Awesome, thanks for clarifying @roryabraham 🙌 From what you've written it sounds like there is still something to fix here and that the issue can be |
Job added to Upwork: https://www.upwork.com/jobs/~01418691c14f3167db |
Current assignee @mateocole is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia ( |
Triggered auto assignment to @neil-marcellini ( |
ProposalThis is because we're missing a case when deciding whether to update the When the report was unread then the The fix is to remove that condition. diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js
index 4bbeaa997a..87a81ab1a0 100755
--- a/src/pages/home/report/ReportActionsView.js
+++ b/src/pages/home/report/ReportActionsView.js
@@ -207,7 +207,7 @@ class ReportActionsView extends React.Component {
// If the report is unread, we want to check if the number of actions has decreased. If so, then it seems that one of them was deleted. In this case, if the deleted action was the
// one marking the unread point, we need to recalculate which action should be the unread marker.
- if (ReportUtils.isUnread(this.props.report) && ReportActionsUtils.filterReportActionsForDisplay(prevProps.reportActions).length > this.sortedAndFilteredReportActions.length) {
+ if (ReportActionsUtils.filterReportActionsForDisplay(prevProps.reportActions).length > this.sortedAndFilteredReportActions.length) {
this.setState({newMarkerReportActionID: ReportUtils.getNewMarkerReportActionID(this.props.report, this.sortedAndFilteredReportActions)});
}
|
Proposal 2We can add the condition to only run the update when there's a current diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js
index 4bbeaa997a..87a81ab1a0 100755
--- a/src/pages/home/report/ReportActionsView.js
+++ b/src/pages/home/report/ReportActionsView.js
@@ -207,7 +207,7 @@ class ReportActionsView extends React.Component {
// If the report is unread, we want to check if the number of actions has decreased. If so, then it seems that one of them was deleted. In this case, if the deleted action was the
// one marking the unread point, we need to recalculate which action should be the unread marker.
- if (ReportUtils.isUnread(this.props.report) && ReportActionsUtils.filterReportActionsForDisplay(prevProps.reportActions).length > this.sortedAndFilteredReportActions.length) {
+ if (this.state.newMarkerReportActionID && ReportActionsUtils.filterReportActionsForDisplay(prevProps.reportActions).length > this.sortedAndFilteredReportActions.length) {
this.setState({newMarkerReportActionID: ReportUtils.getNewMarkerReportActionID(this.props.report, this.sortedAndFilteredReportActions)});
}
There could be a number of optimization to be done on this to minimize the trigger time for the |
PROPOSAL If the report is marked as unread and then deleted, it would still show as having a new message even though the report is no longer present. To fix this issue, we could add a check to see if the report still exists before trying to access its properties and actions. If the report has been deleted, you could reset the state of the component. |
Both proposal 1 and proposal 2 working well after the fix: Screen.Recording.2023-02-04.at.11.37.10.mp4 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.73-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-02-24. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
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:
|
Regression Test Proposal
|
Regarding the first 3 checklist items, I think this bug may have been expected after the project to deprecate sequence numbers, so I don't think it's worth tracking down the PR and commenting there. I also don't think we need to raise a discussion because we expected some small bugs after such a large refactor. @s77rt I think the regression test looks good. @mateocole would you please create an issue to add the regression test and handle payment? |
@mateocole bump |
@mateocole bump again |
Bumped again in Slack. I also asked if someone can take over. |
Alright offers sent! |
Accepted, thanks! |
Okay, both payments have been sent |
@mateocole, it is also eligible for the 50% bonus. |
got it one sec |
50% Bonus sent |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
The Green line should not be shown after deleting a marked message, also the "New messages" button at the top of the page when scrolling.
Actual Result:
If you mark a message as unread and then delete it, a "New messages" button does not disappear. Or if you delete messages not at the end but in the middle of the chat, the green line does not disappear.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1,2,61,0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
Notes/Photos/Videos: Any additional supporting documentation
Bug5915033_Recording__259.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: