reload: Clean up handling of invalid reload tokens.

Previously, we'd log an exception whenever an invalid hashchange
reload token appeared, which is probably a bit excessive given that
this can happen without anything being wrong.

We instead just log something for debugging in the blueslip log and
make sure the #reload hash is cleared.
This commit is contained in:
Tim Abbott
2017-05-04 16:16:02 -07:00
parent f207450cdb
commit a493694e10

View File

@@ -106,7 +106,12 @@ exports.initialize = function reload__initialize() {
var ls = localstorage();
var fragment = ls.get(hash_fragment);
if (fragment === undefined) {
blueslip.error("Invalid hash change reload token");
// Since this can happen sometimes with hand-reloading, it's
// not really worth throwing an exception if these don't
// exist, but be log it so that it's available for future
// debugging if an exception happens later.
blueslip.info("Invalid hash change reload token");
hashchange.changehash("");
return;
}
ls.remove(hash_fragment);