Skip to content

WebSocket "Still in CONNECTING state" error #826

Description

@2ndalpha

sendRawMessage() in graphql.service.ts calls socket.send() without checking socket.readyState, causing Failed to execute 'send' on 'WebSocket': Still in CONNECTING state errors.

Race conditions:

Ping interval only checks if (this.socket), not readyState === OPEN

Three independent reconnection triggers (onclose, ping timeout, offline event) can overlap

Re-subscription loop after connection_ack can throw if socket transitions mid-loop

Fix: Add readyState === WebSocket.OPEN guard in sendRawMessage(). Optionally add message queueing and connection locking for robustness.

Same as #740

Metadata

Metadata

Assignees

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