The Wayback Machine - https://web.archive.org/web/20200617180756/https://github.com/sockjs/sockjs-client/issues/99
Skip to content
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

Verbosely document all close event error codes #99

Open
Raynos opened this issue Dec 3, 2012 · 5 comments
Open

Verbosely document all close event error codes #99

Raynos opened this issue Dec 3, 2012 · 5 comments
Labels

Comments

@Raynos
Copy link

@Raynos Raynos commented Dec 3, 2012

The one line description is too ambigious.

Can we have a verbose document explaining what all the close messages mean and what are the possible causes of them included likelyness of each cause.

For example does "server lost session" mean that I restarted the server or could it also be a browser / proxy / ws bug/issue?

@Raynos
Copy link
Author

@Raynos Raynos commented Dec 4, 2012

I did my own internal research and produced this document.

There are some bad jokes in there and vague / inaccurate statements.

From SockJS

Can't connect to server

The info request failed. This is a few reasons

  • Server is down
  • Cross domain XHR request for info fails in legacy browsers

Server lost session

We get an open message from the server when we are already open.
This generally happens when we are using a polling fallback and
the server restarted in between our polling.

SockJS then closes this connection and expects us to manually
open a new one.

  • Server restarted between polls of a polling transport
  • SockJS server bug with losing track of polling session.

All transports failed

SockJS has tried to connect with all transports and they all
failed. It will give you a last_event information that tells
you the closing reason of the last transport that closed.

Almost all the time the reason is that the last transport
(probably a polling one) timed out. This means that either:

  • The internet is down for that user
  • The webserver went down after the info request
  • Shit's fucked up?

Transport timeouted

SockJS tried to open a transport but it timedout. This happens
in IE because "everythin is possible" and when a transport
actually times out because of internet issues / server being down

Normal closure

SockJS closed cleanly because someone called sock.close()

Iframe transport

Unable to load an iframe ( reason )

createIframe failed for some reason.

JSONP polling transport

From the poller

JSONP User aborted read

The JSONP polling transport was closed cleanly. Probably because
someone called sock.close()


From the receiver

JSONP script loaded abnormally (onerror)

The JSONP polling transport tried to load a script tag into the
head but the script tag fired the onerror.

JSONP script loaded abnormally (onload)

The JSONP transport loaded a script tag but it did not behave
as expected. Specifically the onload handler fired without the
actual content of the JSONP result having been loaded. This may
be because the:

  • JSONP payload is incorrect
  • Your using mosiac

JSONP script loaded abnormally (onreadstatechange)

The JSONP transport loaded a script tag but the IE for and
event hack failed and the script didn't work cleanly.

This may be because:

  • SockJS is bugged
  • Your using mosiac

XHR Polling transport

Polling error (permanent)

The polling transport was closed permanently by something.
Specifically the poller is not in a closing state but is
being closed. Someone failed to close the poller cleanly.

Sender (Either JSONP or XHR)

Sending Error ( abort reason )

The sender tried to send a message but it was aborted on the
client-side for some reason. This is must likely a clean or user
based abortion.

Websocket transport

WebSocket connection broken

The websocket connection was closed without receiving a clean
close message from the server. This occurs for a few reasons

  • The server crashed
  • The internet connection dropped
  • Bugs? Proxies? Bad browsers?
@majek
Copy link
Member

@majek majek commented Dec 4, 2012

Great! Did you read the source code, or just grep for didClose?

May I ask why you need such detailed info? Also, are you interested in error code numbers?

@Raynos
Copy link
Author

@Raynos Raynos commented Dec 4, 2012

@majek I read the source code.

I need this information to debug why about 8% of our users can't load our data over sockJS and understand how to make sockJS work more stably.

@majek
Copy link
Member

@majek majek commented Dec 6, 2012

8% is a huge number! Please let me know of the results of your investigation!

@kevinguo
Copy link

@kevinguo kevinguo commented Feb 22, 2013

How do we actually console log these client side errors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.