From 0463bb2c5e5df4e045ea60f992439bedda7a0646 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Sat, 5 May 2018 00:25:46 +0000 Subject: [PATCH] Fix corner case with recent narrowing optimization. For a commit that was just merged I had the "back-out" case at the wrong nesting level. It was a pretty obscure failure scenario that never came up in practice, but basically if you were starting at a message that was not in your narrow, but we did have some messages in your narrow, we would try to go near the old message instead of talking to the server to find the next unread message in that narrow. --- static/js/narrow.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/static/js/narrow.js b/static/js/narrow.js index 7597083f1c..a4cbb85745 100644 --- a/static/js/narrow.js +++ b/static/js/narrow.js @@ -321,15 +321,14 @@ exports.maybe_add_local_messages = function (opts) { if (load_local_messages()) { return select_strategy; } - - // Back out to first_unread strategy since we can't find - // any messages. - select_strategy = { - flavor: 'first_unread', - }; - return select_strategy; - } + + // Back out to first_unread strategy since we can't find + // any messages. + select_strategy = { + flavor: 'first_unread', + }; + return select_strategy; } // We may still be in our original select_strategy.