Skip to content

Commit

Permalink
message_events: Don't update msg if we don't have it cached locally.
Browse files Browse the repository at this point in the history
This fixes a bug where we try to rerender the anchor message even
if we don't have it locally cached which results in error.

The bug was introduced in zulip#31942.
  • Loading branch information
amanagr authored and timabbott committed Oct 18, 2024
1 parent eaee576 commit 1cc9947
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions web/src/message_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,14 @@ export function update_messages(events) {
const stream_archived = old_stream === undefined;

if (!topic_edited && !stream_changed) {
// If the topic or stream of the message was changed,
// If the topic or stream of the anchor message was changed,
// it will be rerendered if present in any rendered list.
messages_to_rerender.push(anchor_message);
//
// But for content edits, we need to schedule it to be
// rerendered, if we have a local copy of it.
if (anchor_message !== undefined) {
messages_to_rerender.push(anchor_message);
}
} else {
const going_forward_change = ["change_later", "change_all"].includes(
event.propagate_mode,
Expand Down

0 comments on commit 1cc9947

Please sign in to comment.