-
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
CRITICAL: Update Mute
behavior to not show as unread in the LHN.
#33619
Comments
Optimistically assigning to @neil-marcellini as I know this was important to him. |
Coming from slack with my understanding of the requirements here. Update
I have a feeling these will be more complex than they might seem on the surface but I'm going to dig in here and try to come up with a plan. |
Current assignee @roryabraham is eligible for the Engineering assigner, not assigning anyone new. |
Slight modification to the above:
|
It looks like this should be relatively easy to accomplish by updating this diff --git a/auth/lib/Report.cpp b/auth/lib/Report.cpp
index c1d0e6cc5c..993ee0151a 100644
--- a/auth/lib/Report.cpp
+++ b/auth/lib/Report.cpp
@@ -5097,13 +5097,16 @@ JSON::Value Report::getChats(SQLite& db, const int64_t accountID, const list<str
" OR r.reportID IN parentReportsWithOutstandingChildRequest "
// Task assigned to accountID is not complete
" OR (COALESCE(JSON_EXTRACT(rnvps.rNVPs, " + SQ("$." + string(NVP_TYPE)) + "), '') = " + SQ(TYPE_TASK) + " AND r.managerID = " + SQ(accountID) + " AND status = " + SQ(STATUS_OPEN) + ") "
- // Reports with unread comments: lastReadTime_ is older than the lastReportAction.created
+ // Reports with unread comments: lastReadTime_ is older than the lastReportAction.created, except those w/ notification preference "muted"
" OR ("
- " CASE "
- " WHEN " + lastReportActionType + " = " + SQ(ACTION_CLOSED) + " THEN lastVisibleActionCreatedBeforeArchived "
- " ELSE " + lastReportActionCreated + " "
- " END > " + lastReadTime + " "
- " ) "
+ " ("
+ " CASE "
+ " WHEN " + lastReportActionType + " = " + SQ(ACTION_CLOSED) + " THEN lastVisibleActionCreatedBeforeArchived "
+ " ELSE " + lastReportActionCreated + " "
+ " END > " + lastReadTime + " "
+ " )"
+ " AND COALESCE(JSON_EXTRACT(rnvps.rNVPs, " + SQ("$." + string(NVP_NOTIFICATION_PREFERENCES) + "." + to_string(accountID)) + "), '') != " + SQ(NOTIFICATION_PREFERENCE_MUTE) +
+ " ) "
// Retrieve the user's primary policy workspace chat if it's available so it can be accessed locally for requesting money
+ (policyWorkspaceChatID > 0 ? ownPolicyExpenseChatFilter : "") +
// Transaction threads are returned so they can be displayed on NewDot's chat list with RBR when they have violations Draft PR for that piece here: https://github.com/Expensify/Auth/pull/9560 |
For this piece, it looks like "whether a chat is unread" in the LHN is determined here, by diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts
index b41b74cd57..5a746b9e45 100644
--- a/src/libs/ReportUtils.ts
+++ b/src/libs/ReportUtils.ts
@@ -3269,6 +3269,10 @@ function isUnread(report: OnyxEntry<Report>): boolean {
return false;
}
+ if (report.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.MUTE) {
+ return false;
+ }
+
// lastVisibleActionCreated and lastReadTime are both datetime strings and can be compared directly
const lastVisibleActionCreated = report.lastVisibleActionCreated ?? '';
const lastReadTime = report.lastReadTime ?? ''; However, I think we'll want to control that by a flag, because there are other places where |
Have a WIP PR for the front-end bits here, but I asked some clarifying questions in slack: https://expensify.slack.com/archives/C0671JDRKQW/p1703880645818079?thread_ts=1703723716.270759&cid=C0671JDRKQW |
Laying out some more clarifications about expected behavior. Action taken:
Expected result: The new message indicator in the chat moves to indicate the new unread message, but the report still does not appear as bold in the LHN. Action taken:
Expected result: User A sees their DM with User B appear in the LHN with a green dot indicating that there's some action for them to perform (in this case, pay an IOU). However, the report should not appear as bold. Action taken:
Expected result: User A sees their DM with User B appear in the LHN with a green dot indicating that there's some action for them to perform (in this case, complete a task). However, the report should not appear as bold. Action taken:
Expected result: User A sees the room appear in their LHN with a green dot indicating that there's some action for them to perform (in this case, respond to the person that directly mentioned them). However, the report should not appear as bold. |
Added very detailed test steps in #33779 |
Ran into some issues with my dev environment while testing this, created a thread in #vm here |
The source of my woes was that due to a recent change w/ reliable updates I needed to be running bwm. Ioni sent out an email and we're discussing running bwm as a service in the VM to make the dev environment more automatic. Anyways, during my testing I found that a number of things just weren't working as expected, and then I discovered that was due to a recent regression on staging. I created a PR to fix that regression that we'll want to CP to staging, but I was blocked on completing my testing until that's merged. |
Was trying to push this over the finish line today, but was blocked by an unrelated deploy blocker. |
Removing reviewing label so this doesn't appear greyed out in my K2 |
This is currently blocked by #34466 |
Mute
behavior to not show as unread in the LHN.Mute
behavior to not show as unread in the LHN.
#34466 has been merged, this is no longer blocked. What are next steps? |
Mute
behavior to not show as unread in the LHN.Mute
behavior to not show as unread in the LHN.
PR put in for review. Just a note, I think I'll create an external follow-up issue to cover my changes with automated tests in the existing |
Can you link the PR here? I'm not sure what you are referring to with "PR put in for review". |
This is the PR: #33779 |
Woohoo deployed to staging! |
Note: This is being actively discussed in Slack here.
Strategy:
Supporting a billion users requires supporting a wide variety of work styles. We know even from our early discussions that the behavior of the LHN is extremely personal, with very subtle variations resulting in significant visceral reactions. While we can't satisfy everyone (and if we think a particular flow is bad, we might not want to), all things being equal we should aim to be as inclusive of as many workflows as possible.
Problem:
Coming from this discussion, we've realized our current Mute behavior only partially mutes. It does disable realtime notifications on that channel, and also disables UnreadMessageSummary on that channel. But it still shows the chat as unread in the LHN. To avoid this LHN distraction requires someone to leave/join the channel frequently, which is cumbersome, and distracting to the rest of the channel (because of your leave/join messages).
Solution:
Mimic Slack and make Mute fully mute, by not showing as unread in the LHN. This has at least a few benefits:
So there are advantages to mimicking Slack's Mute behavior. Are there any disadvantages? Is anyone using our current Mute behavior who would be annoyed by this change?
The text was updated successfully, but these errors were encountered: