Skip to content

[TS] HubConnection stuck in Disconnecting state #30839

Closed
@M0ns1gn0r

Description

@M0ns1gn0r

Describe the bug

After I wake up my PC from sleep, the WebSocket connection gets terminated (which is OK). Sometimes it cannot be restarted and then HubConnection.state becomes Disconnecting forever:

  • .start() always throws Cannot start a HubConnection that is not in the 'Disconnected' state.
  • .stop() returns a promise which doesn't resolve ever.

Logs after waking up the PC from sleep:

image


Internals of the corrupted HubConnection:

image

Exceptions (if any)

Error: Cannot start a HubConnection that is not in the 'Disconnected' state.
    at e.<anonymous> (2.1fa56808.chunk.js:formatted:42032)
    at 2.1fa56808.chunk.js:formatted:41930
    at Object.next (2.1fa56808.chunk.js:formatted:41943)
    at 2.1fa56808.chunk.js:formatted:41850
    at new Promise (<anonymous>)
    at C (2.1fa56808.chunk.js:formatted:41829)
    at e.startWithStateTransitions (2.1fa56808.chunk.js:formatted:42026)
    at e.start (2.1fa56808.chunk.js:formatted:42021)
    at e.<anonymous> (SignalRService.ts:39)
    at s (2.1fa56808.chunk.js:formatted:60817)

Further technical details

  • Chrome 89.0.4389.72
  • @microsoft/signalr 5.0.3
  • Azure Functions V3
  • Azure SignalR service in "Serverless" mode.

Metadata

Metadata

Assignees

Labels

area-signalrIncludes: SignalR clients and serversbugThis issue describes a behavior which is not expected - a bug.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions