zulip/zerver
Sahil Batra aeb9a27d0e message: Ignore messages in unsubcribed streams when marking them unread.
Zulip's unread messages design has an invariant that all unread stream
messages must be in streams the user is subscribed to. For example, We
do not include the unread messages from unsubscribed streams in the
"unread_msgs" data structure in "/register" response and we mark all
unread messages as read when unsubscribing a user from a stream.

Previously, the mark as unread endpoint allowed violating that
invariant, allowing you to mark messages in any stream as unread.

Doing so caused the "message_details" data structures sent with
"update_message_flags" events to not contain messages from
unsubscribed streams, even though those messages were present in the
set of message IDs. These malformed events, in turn, caused exceptions
in the frontend's processing of such an event.

This change is paired with a separate UI change to not offer the "Mark
as unread" feature in such streams; with just this commit, that will
silently fail.

With some additions to the tests by tabbott.
2022-11-02 14:49:23 -07:00
..
actions message: Ignore messages in unsubcribed streams when marking them unread. 2022-11-02 14:49:23 -07:00
data_import slack: Skip files where file_access: file_not_found. 2022-10-25 12:18:20 -07:00
integration_fixtures/nagios
lib delete_topic: Use the same timeout pattern as /mark_all_as_read. 2022-11-02 16:50:06 -04:00
management delete_realm: Use Message.realm column for message count. 2022-10-31 09:57:42 -07:00
migrations markdown: Pass realm down into render_stream_description. 2022-11-01 08:20:47 -07:00
openapi delete_topic: Use the same timeout pattern as /mark_all_as_read. 2022-11-02 16:50:06 -04:00
tests message: Ignore messages in unsubcribed streams when marking them unread. 2022-11-02 14:49:23 -07:00
tornado python: Replace avoidable uses of __special__ attributes. 2022-10-10 08:32:29 -07:00
views delete_topic: Use the same timeout pattern as /mark_all_as_read. 2022-11-02 16:50:06 -04:00
webhooks python: Mark dict parameters with defaults as read-only. 2022-10-06 13:48:28 -07:00
worker python: Use format string for logging str(obj). 2022-10-10 08:32:29 -07:00
__init__.py
apps.py sentry: Initialize sentry in AppConfig ready hook. 2022-09-26 12:42:36 -07:00
context_processors.py templates: Rename `OPEN_GRAPH` variables to `PAGE` or `PAGE_METADATA`. 2022-09-06 14:57:06 -07:00
decorator.py python: Clean up getattr, setattr, delattr calls with literal names. 2022-10-10 08:40:28 -07:00
filters.py typing: Fix function signatures. 2021-08-20 05:54:19 -07:00
forms.py forms: Fix another 500 error on realm creation with invalid email. 2022-09-19 14:12:32 -07:00
logging_handlers.py python: Use Python 3.8 typing.{Protocol,TypedDict}. 2022-04-27 12:57:49 -07:00
middleware.py python: Clean up getattr, setattr, delattr calls with literal names. 2022-10-10 08:40:28 -07:00
models.py cache: Only cache list results of QuerySets, not the QuerySet itself. 2022-10-12 22:25:48 -07:00
signals.py requirements: Upgrade to Django 4.0. 2022-07-13 16:07:17 -07:00