From ba2de34414a780e56263bf63a2aa8784716454a6 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 15 Jun 2020 10:47:10 -0700 Subject: [PATCH] message edit: Move and clarify an important comment. --- static/js/message_events.js | 8 ++++++++ static/js/stream_topic_history.js | 3 --- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/static/js/message_events.js b/static/js/message_events.js index 16bfcca093..cf3dbc3878 100644 --- a/static/js/message_events.js +++ b/static/js/message_events.js @@ -179,6 +179,14 @@ exports.update_messages = function update_messages(events) { // Remove the recent topics entry for the old topics; // must be called before we call set_message_topic. + // + // TODO: Use a single bulk request to do this removal. + // Note that we need to be careful to only remove IDs + // that were present in stream_topic_history data. + // This may not be possible to do correctly without extra + // complexity; the present loop assumes stream_topic_history has + // only messages in message_store, but that's been false + // since we added the server_history feature. stream_topic_history.remove_message({ stream_id: msg.stream_id, topic_name: msg.topic, diff --git a/static/js/stream_topic_history.js b/static/js/stream_topic_history.js index de9781d0c7..79510a0008 100644 --- a/static/js/stream_topic_history.js +++ b/static/js/stream_topic_history.js @@ -199,9 +199,6 @@ exports.per_stream_history = function (stream_id) { exports.remove_message = function (opts) { const stream_id = opts.stream_id; const topic_name = opts.topic_name; - // Number of messages to remove - // TODO: Use this option when moving - // topic between stream in message_events.js const num_messages = opts.num_messages || 1; const history = stream_dict.get(stream_id);