-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught (in promise) DOMException #23
Comments
Root cause:
The issue is the following: The The destroy function is requesting a sync DELETE request (line 190 of loader.js) which is called from line 40 of gds.js during |
Confirmed that in the current GDS setup the DELETE session is not fired. Chrome ignores synchronous calls at It seems there is no reliable way to inform the server when page is unloads.
Modern Browsers ignore synchronous calls on beforeunload event. So there is no point to keep the following: So the above should be changed to: xhttp.open(method, endpoint + "?_no_cache=" + random + "&session=" + _self.session, true); There are two ways to delete the session:
document.addEventListener('visibilitychange', function logData() {
if (document.visibilityState === 'hidden') {
_loader.destroy();
}
}); The above will still not delete the session on unload, but it should be fine since the session ID will change after Browser refresh.
window.addEventListener('beforeunload', function (e) {
_loader.destroy();
let counter = 0;
for (let i = 0; i < 1000000 ; i++){
counter += 1;
}
return counter;
}); The above will fire beforeunload event. |
Closing this, says it was merged. |
Problem Description
On initial load or refresh of the page Chrome complains about the following error:
How to Reproduce
Preserve Log
Expected Behavior
There should be no error when refreshing page
The text was updated successfully, but these errors were encountered: