mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
It's possible for selected_message_id to not exist in zhome. For instance, when you open the page to a narrowed URL, there is a race between loading the narrowed messages and loading all your messages. If the narrowed message request completes first, it will update selected_message_id to your initial_pointer if the latter happens to be among the narrowed messages. Even if it is not, you can select a message by clicking on it before the zhome request finishes. Then the old code would never add that selected_message_id to the zhome table, so it wouldn't show up in the Home view or if you re-narrowed. I'm pretty sure there are still cases where the selected_message_id might be outside the range of messages in zhome, in which case adding to zhome might put old messages at the bottom. I observed this twice on staging but was unable to reproduce it consistently. (imported from commit 162feff3090f8806cc67140db0cfabb6e965aece)
28 KiB
28 KiB