mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
The message list data structure never had the rendered_idx values initiatized except via _maybe_rerender (called when a message is selected). For the narrowed message list for streams with no messages yet, we didn't select a message (as there was none to select); the end result is that msg_list.append() will never rerender because it tries to subtract undefined from undefined and gets NaN in its test for whether it needs to rerender. So fix this by initializing _min_rendered_idx and _max_rendered_idx to valid values for the empty message list (the closed interval from 0 to -1). (imported from commit 6afecb1569185a842a3a9108cedba7e88f8befad)