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.
This commit is contained in:
Steve Howell 2018-05-05 00:25:46 +00:00 committed by Tim Abbott
parent 4573bdd005
commit 0463bb2c5e
1 changed files with 7 additions and 8 deletions

View File

@ -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.