From 576b966edc0db111371f0227aaa98a39ce939621 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Thu, 27 Jan 2022 13:56:51 +0000 Subject: [PATCH] search suggestions: Add comment about server history. --- static/js/search_suggestion.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/js/search_suggestion.js b/static/js/search_suggestion.js index dee90334cd..cc4dca6287 100644 --- a/static/js/search_suggestion.js +++ b/static/js/search_suggestion.js @@ -375,7 +375,14 @@ function get_topic_suggestions(last, operators) { } // Fetch topic history from the server, in case we will need it. + // Note that we won't actually use the results from the server here + // for this particular keystroke from the user, because we want to + // show results immediately. Assuming the server responds quickly, + // as the user makes their search more specific, subsequent calls to + // this function will get more candidates from calling + // stream_topic_history.get_recent_topic_names. stream_topic_history_util.get_server_history(stream_id, () => {}); + const candidate_topics = stream_topic_history.get_recent_topic_names(stream_id); if (!candidate_topics || !candidate_topics.length) {