Skip to content
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

App shows an unread count of 1 while no unreads appear in LHN #25774

Closed
shawnborton opened this issue Aug 23, 2023 · 24 comments
Closed

App shows an unread count of 1 while no unreads appear in LHN #25774

shawnborton opened this issue Aug 23, 2023 · 24 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@shawnborton
Copy link
Contributor

@fedirjh Here is the relevant Slack conversation.

It seems like the logic in this PR filters what is shown in the LHN as unread/read. However, I have noticed that a room that I have muted might have a new message, causing my unread count to go to 1, but this message does not show up in the LHN.

However, I see the unread message in Expensify.com:
image

@shawnborton shawnborton assigned fedirjh and unassigned fedirjh Aug 23, 2023
@shawnborton
Copy link
Contributor Author

cc @joelbettner @thesahindia @luacmartins @Beamanator as you were reviewers of the potentially offending PR.

and cc @fedirjh for conversation in Slack.

@luacmartins luacmartins self-assigned this Aug 23, 2023
@luacmartins luacmartins added the Bug Something is broken. Auto assigns a BugZero manager. label Aug 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

Triggered auto assignment to @laurenreidexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Daily KSv2 label Aug 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@hungvu193
Copy link
Contributor

hungvu193 commented Aug 24, 2023

I don't think the linked PR is the RCA of this issue, it actually came from this PR:
#22717

const isMuted = optionItem.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.MUTE;
if (isMuted && !props.isFocused && !optionItem.isPinned) {
return null;
}

So if a report is muted, not pinned or focused it will disappear from LHN because it rendered null.

We also didn't send notification if current notification preference of the room is daily or mute (but still received the pusher event), that's why

App/src/libs/actions/Report.js

Lines 1547 to 1552 in 00efce4

// We don't want to send a local notification if the user preference is daily or mute
const notificationPreference = lodashGet(allReports, [reportID, 'notificationPreference'], CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS);
if (notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.MUTE || notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.DAILY) {
Log.info(`${tag} No notification because user preference is to be notified: ${notificationPreference}`);
return false;
}

That's a little bit weird, I think we should still show the mute room but give it the lowest priority and not bold the text when we have new messages also update the logic here for not counting the mute report.

callback: (reportsFromOnyx) => {
const unreadReports = _.filter(reportsFromOnyx, ReportUtils.isUnread);
updateUnread(_.size(unreadReports));
},

@fedirjh
Copy link
Contributor

fedirjh commented Aug 24, 2023

it actually came from this PR:
#22717

That PR seems to be reverted, then this PR #23521 reintroduced the same logic


There is another open PR #25618 that may fix this bug.

@hungvu193
Copy link
Contributor

There is another open PR #25618 that may fix this bug.

Yeah, but it seems still in progress, I didn't see the logic to handle unread for hidden report, or may be there's a backend fix for that 🤔

@shawnborton
Copy link
Contributor Author

@chiragsalian can you take a look here? Looks like your PR might be the offending PR that caused this.

@chiragsalian
Copy link
Contributor

Yeah i think this will be solved once this is live. Perhaps we can revisit this issue once my PR is live. With my changes even if you muted a chat it will show up in your LHN so this way you should be able to see those unread muted chats.

@luacmartins luacmartins changed the title App shows an unread count of 1 while no unreads appear in LHN [HOLD deploy #25618] App shows an unread count of 1 while no unreads appear in LHN Aug 25, 2023
@luacmartins
Copy link
Contributor

Thanks for confirming @chiragsalian! Added a hold to this issue.

@melvin-bot melvin-bot bot added the Overdue label Aug 28, 2023
@luacmartins
Copy link
Contributor

on hold

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Aug 28, 2023
@luacmartins
Copy link
Contributor

still on hold

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Aug 30, 2023
@laurenreidexpensify
Copy link
Contributor

#25618 is deployed to prod as of Thursday, are we good to take off hold?

@melvin-bot melvin-bot bot removed the Overdue label Sep 4, 2023
@luacmartins
Copy link
Contributor

Yes, we can remove the hold. Is this issue still reproducible?

@laurenreidexpensify
Copy link
Contributor

@shawnborton @chiragsalian can you confirm if this is still reproducible, or list the repro steps so I can test. thanks!

@laurenreidexpensify laurenreidexpensify changed the title [HOLD deploy #25618] App shows an unread count of 1 while no unreads appear in LHN App shows an unread count of 1 while no unreads appear in LHN Sep 7, 2023
@shawnborton
Copy link
Contributor Author

Hmm well now what's happening is that I have the #announce room for the Lounge Workspace muted, but I still get unreads shown in my LHN for that room. Is that intended?

@hungvu193
Copy link
Contributor

Hmm well now what's happening is that I have the #announce room for the Lounge Workspace muted, but I still get unreads shown in my LHN for that room. Is that intended?

According to the PR, I think yes. But I think it's little weird, how about my suggestion here?

That's a little bit weird, I think we should still show the mute room but give it the lowest priority and not bold the text when we have new messages also update the logic here for not counting the mute report.

callback: (reportsFromOnyx) => {
const unreadReports = _.filter(reportsFromOnyx, ReportUtils.isUnread);
updateUnread(_.size(unreadReports));
},

@shawnborton
Copy link
Contributor Author

Curious for @chiragsalian's thoughts on that one.

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

@luacmartins, @fedirjh, @laurenreidexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

@luacmartins, @fedirjh, @laurenreidexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

@luacmartins
Copy link
Contributor

@chiragsalian can you check this comment please?

@melvin-bot melvin-bot bot removed the Overdue label Sep 11, 2023
@luacmartins
Copy link
Contributor

Hmm well now what's happening is that I have the #announce room for the Lounge Workspace muted, but I still get unreads shown in my LHN for that room. Is that intended?

@shawnborton so you don't get notifications for it but the LHN still shows something as unread?

@luacmartins
Copy link
Contributor

Maybe we need to update the logic in isUnread to return false if the report is muted?

@luacmartins
Copy link
Contributor

Just chatted with Jason and apparently this is intended. According to E.cash: Default Rooms & Room Notifications design doc, muted chats should count towards the unread count:

Chat room is bolded as “unread” in LHN, and the chat room moves in the LHN in-line with the existing lastMessage sorting logic in place for DMs

@luacmartins
Copy link
Contributor

So I think there's nothing to do here since this is the expected behavior. I'm gonna close the issue. Please reopen if I missed something!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
None yet
Development

No branches or pull requests

6 participants