You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, localStorage and sessionStorage seem to be unreliable in some browsers. Safari 12.1.1 exhibits a similar behavior as described in this StackOverflow post. Both localStorage and sessionStorage sometimes appear empty if our function handlePotentialOauthRedirect() is called “too soon” (and they remain empty while staying on the same page). Unlike hypothesized in the StackOverflow discussion, however, the issue in Safari still occurs when this function is called only after the DOM-ready event. The workaround mentioned on StackOverflow -- accessing sessionStorage.length -- does not help.
Unfortunately,
localStorage
andsessionStorage
seem to be unreliable in some browsers. Safari 12.1.1 exhibits a similar behavior as described in this StackOverflow post. BothlocalStorage
andsessionStorage
sometimes appear empty if our functionhandlePotentialOauthRedirect()
is called “too soon” (and they remain empty while staying on the same page). Unlike hypothesized in the StackOverflow discussion, however, the issue in Safari still occurs when this function is called only after the DOM-ready event. The workaround mentioned on StackOverflow -- accessingsessionStorage.length
-- does not help.Interestingly, after one or sometimes multiple reloads (in the same window/tab), Safari suddenly does show the expected key/value pairs (as expected in the first place -- since we previously created them in
goToOauthPage()
). Since Safari switches to a new process whengoToOauthPage()
setswindow.location.href
, it’s possible that instead of the new process accessingsessionStorage
“too soon,” it is actually the previous process that persistssessionStorage
“too late.” Indeed, Safari writessessionStorage
updates to disk with a delay of up to 1 second:https://trac.webkit.org/browser/webkit/releases/Apple/Safari%2012.1.1/WebKit/UIProcess/WebStorage/LocalStorageDatabase.cpp#L235
Other relevant source code in WebKit:
The following FIXME in the WebKit code could be a contributor to the problem, too:
Interestingly, the FIXME suggestion could be done easily, given this changeset:
There is also another StackOverflow post mentioning the above StackOverflow post (though no conclusive answer, either).
The text was updated successfully, but these errors were encountered: