Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

message_view: Don't check recent view data for anchor fetch status.

Shubham Padiabf383e70fb96
diff --git a/web/src/message_view.ts b/web/src/message_view.ts
index d213ce73208..112f9f4bfff 100644
--- a/web/src/message_view.ts
+++ b/web/src/message_view.ts
@@ -48,7 +48,6 @@ import {page_params} from "./page_params.ts";
import * as people from "./people.ts";
import * as pm_list from "./pm_list.ts";
import * as popup_banners from "./popup_banners.ts";
-import {recent_view_messages_data} from "./recent_view_messages_data.ts";
import * as recent_view_ui from "./recent_view_ui.ts";
import * as recent_view_util from "./recent_view_util.ts";
import * as resize from "./resize.ts";
@@ -1011,34 +1010,6 @@ function navigate_to_anchor_message(opts: {
if (is_anchor_fetched(message_lists.current.data)) {
select_msg_id(message_list_data_to_target_message_id(message_lists.current.data));
return;
- } else if (is_anchor_fetched(recent_view_messages_data) && anchor !== "date") {
- // We can load messages into `msg_list_data` but we don't know
- // the fetch status until we contact server. If we are contacting the
- // server, it is better to just fetch the required messages instead
- // of just fetching status.
- //
- // So, a cheaper check is to see if we have found the anchor in
- // `recent_view_messages_data`, and if we have, we can say `msg_list_data`
- // will also have the anchor (for oldest / newest anchors at least).
- //
- // We skip this for date anchor since message_list_data_to_target_message_id
- // for date anchor heavily relies on has_found_oldest/newest being up-to-date.
- // When using load_local_messages, we do not copy fetch_status over to
- // msg_list_data, which causes error in message_list_data_to_target_message_id.
- // See https://github.com/zulip/zulip/pull/37198#issuecomment-3858015457 for
- // more details.
- const msg_list_data = new MessageListData({
- filter: message_lists.current.data.filter,
- excludes_muted_topics: message_lists.current.data.excludes_muted_topics,
- excludes_muted_users: message_lists.current.data.excludes_muted_users,
- });
- load_local_messages(msg_list_data, recent_view_messages_data);
- // It is still possible that `recent_view_messages_data` doesn't have any messages
- // for the current narrow, so we check for that.
- if (!msg_list_data.visibly_empty()) {
- select_anchor_using_data(msg_list_data);
- return;
- }
}
const msg_list_data = new MessageListData({