-
Notifications
You must be signed in to change notification settings - Fork 115
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
Statements no longer sent when browser (Chrome) closed #166
Comments
Doesn't look like the Beacon API can be used as you cannot customise the headers as required for xAPI. You can instead use the Fetch API with the keepalive flag. Where the Fetch API is not supported, e.g. IE11, the current XHR requests can still be used and sent synchronously for any statements sent when the browser is closed. |
…succession to the same object, to persist the older data, even if the calls where fired in the correct order. State calls are now queued, so it is no longer possible for the LRS to save the states in the wrong order due to the time it takes to execute the asynchronous requests. This also required a move from the XHR requests used in the ADLWrapper as these do not work with the callback functionality used with Async.queue. Moved to using the Fetch API with a modified polyfill for browsers which don't support the API or the keepalive attribute, to resolve adlnet/xAPIWrapper#166.
It is possible to use the Beacon API here, by relying on the old IE fallback mechanism in the LRS ("Alternate Request Syntax"), which allows headers to be passed in the body of the request and the method to be passed in the query string, see https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#alt-request-syntax -EDIT- |
Now that Chrome has finally deprecated synchronous XHR in Chrome 80, any statements triggered when the browser closes will be lost, as asynchronous calls will not be resolved in time. This is important if using terminated type statements, and is actually a requirement if following the cmi5 profile.
Not sure whether other browsers will follow, but should the wrapper look to use the Beacon API (with a Polyfill for IE11) to handle the communication?
The text was updated successfully, but these errors were encountered: