mirror of
https://github.com/zulip/zulip.git
synced 2025-10-28 02:23:57 +00:00
unread: Fix mark all as read when oldest unread message is muted.
As detailed in the comment, the new "mark all as read" bankrupcty code path would fail to mark as read muted stream messages that are older than the oldest unread non-muted message. This was because of the semantics of the `first_unread` anchor value being actually "fire unmuted unread". We can just change this to "oldest", because we're already using an `is:unread` for the narrow query; doing so likely is a small optimization, since we save the query to compute the first unread.
This commit is contained in:
@@ -23,7 +23,11 @@ let loading_indicator_displayed = false;
|
||||
|
||||
export function mark_all_as_read(args = {}) {
|
||||
args = {
|
||||
anchor: "first_unread",
|
||||
// We use an anchor of "oldest", not "first_unread", because
|
||||
// "first_unread" will be the oldest non-muted unread message,
|
||||
// which would result in muted unreads older than the first
|
||||
// unread not being processed.
|
||||
anchor: "oldest",
|
||||
include_anchor: true,
|
||||
messages_read_till_now: 0,
|
||||
...args,
|
||||
|
||||
Reference in New Issue
Block a user