Processing 1k messages takes roughly 1s on a live server like
chat.zulip.org, which is a good enough duration after which
user will be looking to get some feedback on the request. Once
we show the in-progress banner, it makes sense to do bigger
batches to speed up the process.
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.
Adjusts the check in `message_filter.process_results` to happen
after the messages have been processed so that the empty narrow
banner is shown if there are no messages in the current message
list, which covers the case of there being no messages returned
from the server (e.g. a keyword search, no private messages with
a user) and the case of all existing stream topics being muted
by the current user.
This matches the current bulk-operation behavior of the message lists,
and avoids spending an enormous amount of time adjusting unread counts
once per message in a loop over thousands of messages.
Also add some comments on adjacent code paths.
As of 550a32b, when private messages were added to recent
conversations, `recent_topics_data.process_message` will
always return true.
Updates `recent_topics_data.process_message` for no return
value. Also, removes the `topic_data_changed` logic from
`recent_topics_ui.process_messages` and instead checks for
messages to process before updating the data and calling the
rerender.
`recent_topics_ui.complete_rerender` first checks for whether
the recent conversations view is visible before rerendering.
This commit reverts the changes for replace_syntax in 1ca4566eb2
and we again use JS replace instead of replace from text-field-edit.
We do this change because replace from text-field-edit leaves the
replaced text selected, which we don't want. This change is
temporary and we can probably use replace method from
text-field-edit once this issue is fixed in upstream.
Fixes#23406.
Fixes#14053.
This also uses the new alert banner system.
It is not clear if we want to scroll user to the end of the narrow
after this update is complete. There is a "scroll to bottom" button
for users who want to be placed at the end of the narrow but there
is no reverse option for users who don't. So, maybe not changing
the scroll position is preferred especially since we now use
banners for the update where a user could have been reading something
while we were updating the message flags in the background.
We do not handle the case of `mark as read` and `mark as unread`
both running in batches at the same (This is a somewhat rare case
given the high cap on `NUM_OF_MESSAGES_UPDATED_PER_BATCH` but
possible.).
`unread.declare_bankruptcy` is no longer used in the code but
we keep it since it is used extensively in tests.
Previous algorithm was not correct if we didn't have full data for
the current narrow loaded from the server. #23512 adds the support
to mark messages in a narrow unread after a give message_id.
Added a new alert banner to indicate loading and success states of
an ongoing request. This is useful when requests can take a long
time to complete.
Doing rapid pace mark-as-unread in the Zulip web application, one
observed assertion failures showing that the server would send an
event containing multiple message IDs but only one of the messages
present in the message_details side data structure.
The cause of this was the "virtual events" compression system; two
flags/remove/read events were being combined by simply concatenating
the lists of events, without any attempt to merge the
`message_details` field on those objects.
The immediate fix is to disable virtual events compression for this
event class, but it's not unlikely we'll need to just eliminate the
virtual_events system entirely, because it seems difficult to make it
soundly handle a message whose state for a given flag changes back and
forth while the client is offline.
But we'll leave that for later, since removing that optimization
deserves more discussion than fixing this event corruption bug.
The naive solution #23465 creates situations where the same user can have
multiple reactions as the base emojis are not unique, e.g. +1::skin2
and +1::skin4 would both reduce to +1 but the userlists are separate.
This solution handles the reduction, merges the same-base reactions,
and deduplicates the userlist.
Co-authored-by: Alex Vandiver <alexmv@zulip.com>
Co-authored-by: rht <rhtbot@protonmail.com>
Following b563fdc537, the z-index of the
compose box (2) tied with that of unread date dividers within a topic;
this could lead to the dividers incorrectly appearing on top of the
compose box.
We don't have other elements that can overlap with compose with a
z-index between 2 and 4, so just increase it to 4.
This commit removes comments related to stream-admin option from
wildcard_mention_allowed.
We have already removed stream-admin option from wildcard mention
policy setting in 83383090f9 since we are no longer planning to
implement stream admin feature and instead are working on new
permissions model based on user groups.