Skip to content

Multiple WebSockets are created when a content filter blocks WebSocket #588

@boxmein

Description

@boxmein

When using the Javascript SDK in a browser, and a content filter that restricts WebSocket traffic is in place on the customer's computer, it is possible that multiple websockets are created.

The following sequence of events must occur:

  1. Consumer code calls Qminder.GraphQL.subscribe(...).subscribe(...)
  2. The Connection API key is fetched quickly
  3. The WebSocket initialization handshake starts and an error occurs (e.g. a HTTP 4xx/5xx reply during the handshake)
  4. Another part of consumer code calls Qminder.GraphQL.subscribe(...).subscribe(...) again
  5. The Connection API key is fetched quickly
  6. The WebSocket initialization handshake starts again
  7. The previous sleepMs() timeout introduced in fix: reconnect to socket for all close codes except 1000 #577 is not cancelled, and fires eventually
  8. ⚠️ A second WebSocket is created

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