GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Uncaught exception: TypeError: Cannot convert 'connection.eventSource' to object
Alternatively, you can run the "Connection State Facts: serverSentEvents Manually restarted client maintains consistent state" functional test in the JS test project on Opera.
Opera raises error after EventSource.Close is called which is handled by our function wired via connection.eventSource.addEventListener("error", ....
Since signalR.transports.serverSentEvents.stop(connection) is called before the error handler is called: connection.eventSource is null by the time the error handler is fired. Therefore, trying to access connection.eventSource.readyState in the error event handler fails.
While using this instead of connection.eventSource inside the error handler would fix the AV, there is no reason for the error handler to do anything if the transport that created it was stopped.
I think it is better to set connection.eventSource.ID to null in signalR.transports.serverSentEvents.stop so the error handler will ignore the event since it won't match the currentEventSourceID.
Clear ID before closing EventSource