From eb7fd1ba51a2572cbba53f5ea2397f479fd565c7 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Wed, 30 Oct 2013 13:38:16 -0400 Subject: [PATCH] Add some front-end debugging changes (imported from commit 21684b09100bc0a24372948a9417c973709c1be2) --- static/js/message_list.js | 4 ++++ static/js/narrow.js | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/static/js/message_list.js b/static/js/message_list.js index fd6d94ad49..67918af451 100644 --- a/static/js/message_list.js +++ b/static/js/message_list.js @@ -173,6 +173,10 @@ MessageList.prototype = { {table_name: this.table_name, id: id}); } + if (closest_id === -1) { + blueslip.fatal("Cannot select id -1", {table_name: this.table_name}); + } + id = closest_id; opts.id = id; this._selected_id = id; diff --git a/static/js/narrow.js b/static/js/narrow.js index 0b148146a0..975637e3c5 100644 --- a/static/js/narrow.js +++ b/static/js/narrow.js @@ -101,6 +101,11 @@ exports.activate = function (operators, opts) { return exports.deactivate(); } var filter = new Filter(operators); + blueslip.debug("Narrowed", {operators: _.map(filter.operators(), + function (e) { return e[0]; }), + previous_id: current_msg_list.selected_id(), + previous_is_summarized: current_msg_list.is_summarized_message( + current_msg_list.get(current_msg_list.selected_id()))}); var had_message_content = compose.has_message_content(); @@ -313,6 +318,7 @@ exports.deactivate = function () { if (current_filter === undefined) { return; } + blueslip.debug("Unnarrowed"); if (ui.actively_scrolling()) { // There is no way to intercept in-flight scroll events, and they will