mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 12:33:40 +00:00
event_queue: Actually fix missing copy for edit-message events.
Apparently, our edit-message events did not guarantee that the outer
wrapper dictionary, which is intended to be unique for each client,
was unique for every client (instead only ensuring it was unique for
each user).
This led to clients unexpectedly getting last_event_id validation
errors in this code path when a user had multiple connected clients,
because the linear ordering of event IDs within a given queue was
corrupted.
In fd2a63b049, we accidentally fixed
this issue with a different set of userdata events, without fixing the
edit-message event bug. This commit fixes the remaining issue.
This commit is contained in:
@@ -943,7 +943,9 @@ def process_message_update_event(event_template: Mapping[str, Any],
|
||||
|
||||
for client in get_client_descriptors_for_user(user_profile_id):
|
||||
if client.accepts_event(user_event):
|
||||
client.add_event(user_event)
|
||||
# We need to do another shallow copy, or we risk
|
||||
# sending the same event to multiple clients.
|
||||
client.add_event(dict(user_event))
|
||||
|
||||
def maybe_enqueue_notifications_for_message_update(user_profile_id: UserProfile,
|
||||
message_id: int,
|
||||
|
||||
Reference in New Issue
Block a user