-
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-02-01] MEDIUM: Notification counter has phantom unreads #33506
Comments
Job added to Upwork: https://www.upwork.com/jobs/~0197ab62db4a5e9ffd |
Triggered auto assignment to @CortneyOfstad ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @0xmiroslav ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Unread counter includes reports with What is the root cause of that problem?Although notification preference was What changes do you think we should make in order to solve the problem?Unread counter includes reports with App/src/libs/UnreadIndicatorUpdater/index.ts Lines 14 to 16 in e89e466
This is the easiest fix. What alternative solutions did you explore? (Optional)Fix the BE not to notify |
ProposalPlease re-state the problem that we are trying to solve in this issue.The notification counter goes up when a new message arrives on a report with a HIDDEN notification preference. What is the root cause of that problem?When we have a report with notification preference set to HIDDEN, the report won't be shown on the LHN. Currently, we already exclude any report that doesn't show on LHN from the unread count. App/src/libs/UnreadIndicatorUpdater/index.ts Lines 13 to 16 in b74be72
However, the logic to hide a report with a notification preference of HIDDEN is not included in App/src/components/LHNOptionsList/OptionRowLHN.js Lines 90 to 93 in b74be72
What changes do you think we should make in order to solve the problem?We should move the logic to hide a report with notification preference of HIDDEN to
But the App/src/pages/home/sidebar/SidebarLinksData.js Lines 136 to 171 in b74be72
This way, we have a "single source of truth". |
@CortneyOfstad, @0xmiroslav Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@CortneyOfstad, @0xmiroslav Eep! 4 days overdue now. Issues have feelings too... |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@CortneyOfstad, @0xmiroslav Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it! |
@CortneyOfstad, @0xmiroslav 10 days overdue. I'm getting more depressed than Marvin. |
Was OoO for the holidays — sorry for the delay here! @0xmiroslav any thoughts on the proposals above? Thanks! |
📣 @cubuspl42 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
PR created #34025 |
Once that PR is done, I'd love to hear what ideas there are to make sure this regression doesn't happen again. I feel like this issue keeps cropping up over and over. At the minimum, let's make sure we have some good manual regression tests in place. But maybe we could add some automated tests or something too? |
Agree. If we go the automated route... we should be able to do something like this: diff --git a/src/libs/UnreadIndicatorUpdater/index.ts b/src/libs/UnreadIndicatorUpdater/index.ts
index 4126f2af4e..9c7fffd52a 100644
--- a/src/libs/UnreadIndicatorUpdater/index.ts
+++ b/src/libs/UnreadIndicatorUpdater/index.ts
@@ -8,13 +8,17 @@ import updateUnread from './updateUnread';
let allReports: OnyxCollection<Report> = {};
+function getUnreadReportsForUnreadIndicator(currentReportID) {
+ return Object.values(allReports ?? {}).filter(
+ (report) => ReportUtils.isUnread(report) && ReportUtils.shouldReportBeInOptionList(report, currentReportID ?? '', false, [], {}),
+ )
+}
+
const triggerUnreadUpdate = () => {
const currentReportID = navigationRef.isReady() ? Navigation.getTopmostReportId() : '';
// We want to keep notification count consistent with what can be accessed from the LHN list
- const unreadReports = Object.values(allReports ?? {}).filter(
- (report) => ReportUtils.isUnread(report) && ReportUtils.shouldReportBeInOptionList(report, currentReportID ?? '', false, [], {}),
- );
+ const unreadReports = getUnreadReportsForUnreadIndicator(currentReportID);
updateUnread(unreadReports.length);
}; (obviously do not use the broken logic that is there 😄) But we can export the |
I love that. @cubuspl42 @allroundexperts what do you think? Shall we include it in the PR? Or perhaps do it as a follow-up? |
If we're gonna add this, maybe it's easier to include this in the already open PR. What could also help would be adding some comment here, as this is quite a special value with special meaning (unlike the other options which directly corresponds to actual user-picked preference). |
Hi! What's the status of this? What's the next step, who is doing it, and when will it happen? |
This time it's on me! The latest comments were resolved before the weekend. I'll do the final testing, and very likely, this will be mergeable today. |
Thanks @cubuspl42! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.31-7 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 2024-02-01. 🎊 For reference, here are some details about the assignees on this 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:
|
Payment is not due until tomorrow 👍 |
I think this can be closed based on #33506 (comment) |
@Gonals does that sound good ^^^? |
Yep! |
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.16-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: @shawnborton
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1703179378879089
Action Performed:
Expected Result:
Just looking at a thread shouldn't join it (you need to explicitly join a thread and subscribe to it), and thus shouldn't generate notifications.
Actual Result:
I think the actions here are that I viewed a thread, but didn't participate in it. As such, whenever that thread got a new message, my notification count went up but I had no unread messages in my LHN.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Recording.348.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: