Skip to content

Errors in Firefox when using Socket.IO with a custom parser from a web worker #1149

@ghost

Description

Note: for support questions, please use one of these channels: stackoverflow or slack

You want to:

  • report a bug
  • request a feature

Current behaviour

Starting a connection from a web worker while using a parser that sends binary data (the example uses socket.io-msgpack-parser) causes errors with the polling transport. The issue results in a "server error" exception, which causes an endless connect/disconnect loop.

Steps to reproduce (if the current behaviour is a bug)

Note: the best way to get a quick answer is to provide a failing test case, by forking the following fiddle for example.

Source for test case: sio-worker.zip

Installation/test instructions:

  • Extract sio-worker.zip
  • Run npm install in sio-worker/server
  • Run npm start in sio-worker/server
  • Open sio-worker/client/index.html in Firefox (tested with Firefox 54.0.1)
  • Press F12 in Firefox to open the debugging console. The output should look like this.

Expected behaviour

The client should be able to connect and receive data without errors. It works correctly when using the default parser on the client and server in this example.

Setup

  • OS: Windows
  • browser: Firefox 54.0.1
  • socket.io version: 2.0.3

Other information (e.g. stacktraces, related issues, suggestions how to fix)

The only unusual thing I've noticed so far is that the binary data that comes through the polling transport here is a string in the web worker and an ArrayBuffer outside of the worker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions