zulip/frontend_tests/node_tests
Ryan Rehman 62aab0d9ee message view: Fetch again when "newest" is discarded.
The previous commit introduced a bug where it was not intuitive
for the user to scroll again.
For the current narrow, new messages were fetched again only when
scrolled to the bottom as usually there are many messages displayed.

However when the edge case mentioned in the previous commit
occured, it was not very obvious that a scroll should be done
or we could already be at the bottom and could not scroll again
to trigger a fetch.
`message_viewport.at_bottom` has a relevant comment explaining
this behaviour.

The previous commit handled the rare race condition. However,
there is a possibility that the rare race condition might occur
again while we are handling the previous condition.

This commit resolves these 2 problems by performing a re-fetch
while also resetting the `expected_max_message_id` and this
approach has two benefits:

1. The reset prevents an infinite loop, if somehow the expected
   max message's id gets corrupted resulting in a situation
   where the server can never send an id greater than that even
   after fetching.

2. Even though we stop after just one re-fetch the race condition
   might recursively occur while we handle the previous race
   condition. And even though the reset prevents multiple re-fetches,
   we don't have the missing message problem.

   This is because we treat the next race condition as a new race
   condition instead of it being a continuation of the previous.

   The `expected_max_message_id` gets updated again, on receiving
   a new message. Thus it can again enter the `fetch_status` block
   as the reset value is updated again.
2020-06-16 11:11:16 -07:00
..
lib delete_message: Support bulk_message_deletion. 2020-06-15 10:41:12 -07:00
.eslintrc.json lint: Add JS indentation eslint rules for node_tests. 2018-05-06 19:35:18 -07:00
activity.js right sidebar: Remove "GROUP PMs" section. 2020-05-27 17:57:50 -07:00
alert_words_ui.js alert settings: Relocate alert_word_settings_item.hbs 2020-04-18 15:50:04 -07:00
alert_words.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
billing_helpers.js free trial: Hide free trial message during payment processing. 2020-05-26 17:01:32 -07:00
billing.js billing: Support downgrading plan from /billing page. 2020-05-11 17:20:54 -07:00
blueslip_stacktrace.js blueslip: Make stack trace more readable. 2019-10-31 13:47:54 -07:00
bot_data.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
buddy_data.js buddy_data test: Move huddle_fraction_present test. 2020-05-27 11:02:18 -04:00
buddy_list.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
channel.js zblueslip: Run blueslip.reset after each test. 2020-04-20 08:17:20 -04:00
color_data.js js: Automatically convert _.each to for…of. 2020-02-07 14:09:47 -08:00
colorspace.js js: Automatically convert var to let and const in most files. 2019-11-03 12:42:39 -08:00
common.js js: Automatically convert var to let and const in most files. 2019-11-03 12:42:39 -08:00
components.js stream settings: Correct alignment of filter streams div. 2020-04-21 16:59:41 -07:00
compose_actions.js dead code: Remove useless resize calls. 2020-05-27 17:57:50 -07:00
compose_fade.js compose_fade: Change would_receive_message to use user_id. 2020-06-05 16:08:26 -07:00
compose_pm_pill.js Rename get_realm_persons() to get_realm_users(). 2020-03-22 10:55:11 -07:00
compose_ui.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
compose.js compose: Change needs_subscribe_warning to use user_id. 2020-06-05 16:08:26 -07:00
composebox_typeahead.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
copy_and_paste.js dependencies: Upgrade JavaScript dependencies. 2020-04-18 13:17:01 -07:00
dispatch_subs.js node tests: Use less mocking for stream events. 2020-06-13 15:35:39 -07:00
dispatch.js stream_topic_history: Pluralize remove_message. 2020-06-15 10:52:04 -07:00
drafts.js drafts: Rename open_modal -> open_overlay. 2020-05-09 10:18:59 -04:00
dropdown_list_widget.js dropdown-list-widget: Properly handle disabled state. 2020-05-20 09:51:38 -07:00
echo.js node tests: Auto-include zblueslip for node tests. 2020-04-03 12:56:49 -04:00
emoji_picker.js emoji_picker: Add test that all emoji are in categories. 2020-06-14 10:41:07 -07:00
emoji.js zblueslip: Run blueslip.reset after each test. 2020-04-20 08:17:20 -04:00
fenced_code.js text: Fix some typos (most of them found and fixed by codespell). 2020-03-27 17:25:56 -07:00
fetch_status.js message list: Render new messages only after "newest" is found. 2020-06-16 10:47:52 -07:00
filter.js navbar: Fix navbar for unknown streams. 2020-06-15 16:48:24 -07:00
fold_dict.js zblueslip: Run blueslip.reset after each test. 2020-04-20 08:17:20 -04:00
general.js recent_topics: Only rerender when recent_topics is visible. 2020-06-09 22:08:31 -07:00
hash_util.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
hashchange.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
hotkey.js templates: Show Overlay of Recent Topics. 2020-06-09 22:08:31 -07:00
i18n.js node: Fix i18n node tests following string replacement. 2020-03-25 19:36:43 -07:00
input_pill.js search pills: Update multiple pills creation event behaviour. 2020-06-05 17:16:20 -07:00
keydown_util.js keydown_util: Ignore alt-arrow and similar things. 2018-12-04 12:24:39 -08:00
lazy_set.js zblueslip: Run blueslip.reset after each test. 2020-04-20 08:17:20 -04:00
lightbox.js node tests: Remove most test_log length assertions. 2020-04-08 11:37:27 -04:00
list_cursor.js zblueslip: Run blueslip.reset after each test. 2020-04-20 08:17:20 -04:00
list_render.js list-render: Allow re-rendering individual list items. 2020-05-28 17:10:51 -04:00
markdown.js tests: Remove references to trac.zulip.net. 2020-05-28 17:24:35 -07:00
message_edit.js page_params: Add community_topic_editing_limit_seconds. 2020-06-09 14:40:12 -07:00
message_events.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
message_fetch.js message view: Fetch again when "newest" is discarded. 2020-06-16 11:11:16 -07:00
message_flags.js js: Automatically convert var to let and const in most files. 2019-11-03 12:42:39 -08:00
message_list_data.js message list: Move the FetchStatus object to MessageListData class. 2020-06-02 15:45:39 -07:00
message_list_view.js minor: Clean up blank lines in tests. 2020-04-03 12:56:49 -04:00
message_list.js node tests: Auto-include zblueslip for node tests. 2020-04-03 12:56:49 -04:00
message_store.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
muting.js node test: Remove unnecessary zrequires. 2020-04-22 18:54:27 -04:00
narrow_activate.js narrow: Move the top of narrow notices to message_scroll.js. 2020-06-16 00:21:21 -07:00
narrow_local.js message list: Move the FetchStatus object to MessageListData class. 2020-06-02 15:45:39 -07:00
narrow_state.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
narrow_unread.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
narrow.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
notifications.js notifications: Use addEventListener to register handlers. 2020-04-26 23:02:05 -07:00
password.js minor: Clean up blank lines in tests. 2020-04-03 12:56:49 -04:00
people_errors.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
people.js realm owner: Add frontend implementation of owner role. 2020-06-14 21:20:30 -07:00
pm_conversations.js ui_init: Pass params to pm_conversations.recent. 2020-02-27 11:10:13 -08:00
pm_list.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
poll_widget.js zblueslip: Run blueslip.reset after each test. 2020-04-20 08:17:20 -04:00
popovers.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
presence.js presence: Fix "Last active:" in buddy list when last presence is idle. 2020-05-29 13:26:34 -04:00
reactions.js emoji: Abstract all name_to_codepoint, codepoint_to_name accesses. 2020-05-26 23:33:40 -07:00
recent_senders.js recent_senders: Update data structures for stream/topic edits. 2020-05-12 00:15:26 -07:00
recent_topics.js recent_topics: Select the filter text on lauch. 2020-06-13 16:29:19 -07:00
rendered_markdown.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
rtl.js util.js: Remove util from window. 2020-02-15 12:20:20 -08:00
schema.js lint: Fix comma spacing in node tests. 2018-12-07 13:14:28 -08:00
scroll_util.js zblueslip: Run blueslip.reset after each test. 2020-04-20 08:17:20 -04:00
search_legacy.js navbar: Only set searchbox text when displaying the searchbox. 2020-06-11 15:49:12 -07:00
search_pill.js util.js: Remove util from window. 2020-02-15 12:20:20 -08:00
search_suggestion_legacy.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
search_suggestion.js search: Parse search string correctly. 2020-06-15 20:16:40 -07:00
search.js search tests: Refactor search according to search_legacy. 2020-06-05 17:16:20 -07:00
server_events.js zblueslip: Run blueslip.reset after each test. 2020-04-20 08:17:20 -04:00
settings_bots.js node tests: Just set i18n every time. 2020-02-28 17:11:24 -08:00
settings_data.js settings: Add EMAIL_ADDRESS_VISIBILITY_NOBODY. 2020-03-06 16:34:08 -08:00
settings_muting.js muting: Fix real time sync of muted topics. 2020-04-22 15:07:15 -07:00
settings_org.js node_tests: Fix incorrect stub of discard button. 2020-06-12 19:20:46 -04:00
settings_profile_fields.js minor: Clean up blank lines in tests. 2020-04-03 12:56:49 -04:00
settings_user_groups.js typeahead: Update for email_address_visibility settings. 2020-04-20 20:53:39 -07:00
stream_data.js message list: Move the FetchStatus object to MessageListData class. 2020-06-02 15:45:39 -07:00
stream_events.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
stream_list.js topic_data: Rename topic_data module to stream_topic_history. 2020-04-16 20:11:04 -07:00
stream_search.js js: Automatically convert var to let and const in most files. 2019-11-03 12:42:39 -08:00
stream_sort.js node tests: Just set i18n every time. 2020-02-28 17:11:24 -08:00
stream_topic_history.js stream_topic_history: Pluralize remove_message. 2020-06-15 10:52:04 -07:00
submessage.js js: Automatically convert var to let and const in most files. 2019-11-03 12:42:39 -08:00
subs.js api: Remove is_old_stream property from the stream objects. 2020-06-16 10:26:33 -07:00
support.js js: Automatically convert var to let and const in most files. 2019-11-03 12:42:39 -08:00
timerender.js node tests: Just set i18n every time. 2020-02-28 17:11:24 -08:00
top_left_corner.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
topic_generator.js zblueslip: Run blueslip.reset after each test. 2020-04-20 08:17:20 -04:00
topic_list_data.js topic_data: Rename topic_data module to stream_topic_history. 2020-04-16 20:11:04 -07:00
transmit.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
typeahead_helper.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
typeahead.js js: Convert _.filter(a, …) to a.filter(…). 2020-02-10 14:08:12 -08:00
typing_data.js minor: Clean up blank lines in tests. 2020-04-03 12:56:49 -04:00
typing_status.js js: Use hasOwnProperty correctly or not at all. 2020-05-26 23:33:40 -07:00
ui_init.js refactor: Call compose_fade without triggers. 2020-06-13 15:35:39 -07:00
ui.js node tests: Just set i18n every time. 2020-02-28 17:11:24 -08:00
unread.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
upgrade.js node: Fix test failures due to removed zulip-limited-section. 2020-05-26 21:59:27 -07:00
upload.js home/page_params: Add suffix _mib to clarify the size units. 2020-05-08 14:54:54 -07:00
user_events.js realm owner: Add frontend implementation of owner role. 2020-06-14 21:20:30 -07:00
user_groups.js zblueslip: Run blueslip.reset after each test. 2020-04-20 08:17:20 -04:00
user_pill.js people.js: Rename add() to add_active_user(). 2020-05-26 21:41:54 -07:00
user_status.js zblueslip: Implement tracking extra/lesser blueslip calls. 2020-04-20 08:17:20 -04:00
util.js compose_fade: Change would_receive_message to use user_id. 2020-06-05 16:08:26 -07:00
vdom.js node tests: Remove most test_log length assertions. 2020-04-08 11:37:27 -04:00
widgetize.js zblueslip: Run blueslip.reset after each test. 2020-04-20 08:17:20 -04:00
zblueslip.js zblueslip: Implement tracking extra/lesser blueslip calls. 2020-04-20 08:17:20 -04:00
zjquery.js zjquery: Support empty find results. 2020-05-21 12:32:52 -07:00