mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 04:43:58 +00:00
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:
@@ -106,7 +106,12 @@ exports.initialize = function reload__initialize() {
|
|||||||
var ls = localstorage();
|
var ls = localstorage();
|
||||||
var fragment = ls.get(hash_fragment);
|
var fragment = ls.get(hash_fragment);
|
||||||
if (fragment === undefined) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
ls.remove(hash_fragment);
|
ls.remove(hash_fragment);
|
||||||
|
|||||||
Reference in New Issue
Block a user