zulip/frontend_tests
Ryan Rehman 6637f2dbb7 message list: Render new messages only after "newest" is found.
If a user sends a message while the latest batch of
messages are being fetched, the new message recieved
from `server_events` gets displayed temporarily out of
order (just after the the current batch of messages)
for the current narrow.

We could just discard the new message events if we havent
recieved the last message i.e. when `found_newest` = False,
since we would recieve them on furthur fetching of that
narrow.
But this would create another bug where the new messages
sent while fetching the last batch of messages would not
get rendered. Because, `found_newest` = True and we would
no longer fetch messages for that narrow, thus the new
messages would not get fetched and are also discarded from
the events codepath.

Thus to resolve both these bugs we use the following approach:

* We do not add the new batch of messages for the current narrow
  while `has_found_newest` = False.
* We store the latest message id which should be displayed at the
  bottom of the narrow in `fetch_status`.
* Ideally `expected_max_message_id`'s value should be equal to the
  last item's id in `MessageListData`.
* So the messages received while `has_found_newest` = False,
  will be fetched later and also the `expected_max_message_id`
  value gets updated.
* And after fetching the last batch where `has_found_newest` = True,
  we would again fetch messages if the `expected_max_message_id` is
  greater than the last message's id found on fetching by refusing to
  update the server provided `has_found_newest` = True in `fetch_status`.

Another benefit of not discarding the events is that the
message gets processed not rendered i.e. we still get desktop
notifications and unread count updates.

Fixes #14017
2020-06-16 10:47:52 -07:00
..
casper_lib js: Use hasOwnProperty correctly or not at all. 2020-05-26 23:33:40 -07:00
casper_tests settings: Change user avatar spinner implementation. 2020-06-08 22:48:04 -07:00
node_tests message list: Render new messages only after "newest" is found. 2020-06-16 10:47:52 -07:00
puppeteer_lib puppeteer: Add get_renderered_messages and check_messages_sent. 2020-06-14 13:19:35 -07:00
puppeteer_tests puppeteer: Add 02-message-basic tests. 2020-06-14 13:19:35 -07:00
zjsunit refactor: Call compose_fade without triggers. 2020-06-13 15:35:39 -07:00
.eslintrc.json lint: Check eslint indentation for casper tests. 2018-05-06 19:35:18 -07:00
run-casper python: Sort imports with isort. 2020-06-11 16:45:32 -07:00