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

try/catch xhr.responseType to avoid exception #590

Closed
wants to merge 2 commits into from

Conversation

xosofox
Copy link

@xosofox xosofox commented Dec 12, 2017

The line can cause exceptions on Android 4.x in certain circumstances.

Unfortunately, not reproducible but only visible when logging client errors in production, see #589

Note: the engine.io.js file is the generated output of make engine.io.js, and should not be manually modified.

The kind of change this PR does introduce

  • a bug fix
  • a new feature
  • an update to the documentation
  • a code change that improves performance
  • other

Current behaviour

When logging the JS errors our clients experience, we see quite some significant numbers of

INVALID_STATE_ERR: DOM Exception 11

in chrome on android 4.x and some opera browsers. It is not reproducible, though.

New behaviour

When putting the line in a try/catch, no more errors are logged AND there a no NEW ones, so it looks like it is improving the experience.

Other information (e.g. related issues)

#589

The line can cause exceptions on Android 4.x in certain circumstances.

Unfortunately, not reproducible but only visible when logging client errors in production, see socketio#589
@xosofox
Copy link
Author

xosofox commented Jan 2, 2018

Close & Re-Open to trigger travis

@xosofox xosofox closed this Jan 2, 2018
@xosofox xosofox reopened this Jan 2, 2018
@darrachequesne
Copy link
Member

darrachequesne commented Jan 4, 2018

It seems there is an issue with that pull request: #562

Which affects:

There is an exception when setting xhr.responseType = 'arraybuffer' when xhr.readyState === 2 (which is perfectly valid, spec-wise).

My concern is that, even with your fix, the client will not be able to connect, since it will not be able to parse the content sent by the server. It will not throw anymore though.

Any suggestion? @Nibbler999 ?

darrachequesne added a commit that referenced this pull request Feb 18, 2018
Some XHR implementations (like Firefox WebWorker, react-native and some Android 4.x versions) throw
an exception when setting xhr.responseType = 'arraybuffer' when xhr.readyState === 2 (which is
perfectly valid, spec-wise).

That commit fixes that behaviour by reverting some of the changes from
#562 for those implementations.

Closes #590
darrachequesne added a commit that referenced this pull request Feb 18, 2018
Some XHR implementations (like Firefox WebWorker, react-native and some Android 4.x versions) throw
an exception when setting xhr.responseType = 'arraybuffer' when xhr.readyState === 2 (which is
perfectly valid, spec-wise).

That commit fixes that behaviour by reverting some of the changes from
#562 for those implementations.

Fixes #589
Closes #590
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants