Azure / Azure/azure-webpubsub

stopped event may not be triggered on client when server receives disconnected webhook

Open
#854 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
147
Forks
96
Avg merge
19h 28m
Merged PRs (30d)
87

Description

I'm using the JavaScript SDK with autoReconnect set to false, and I'm encountering a situation where the `stopped` event doesn't seem to be triggered on the client side.

What I've confirmed is that when a connection is lost, the server successfully receives the disconnected webhook, which indicates that the service recognizes the disconnection. However, on the client side, I'm not seeing the `stopped` event being triggered. According to the documentation, when autoReconnect is false, the stopped event should be triggered when the client stops trying to reconnect after disconnection.

I'm wondering if there are known scenarios where the `stopped` event might not be triggered due to network issues or internal SDK behavior? The disconnection appears to be caused by network-level issues rather than an explicit client.stop() call. Should I be manually calling client.stop() in the disconnected event handler as a workaround when autoReconnect is false, or is this potentially a bug in the SDK?

Any insights would be greatly appreciated. Thank you!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the disconnected-webhook and missing stopped-event behavior with the JavaScript SDK, autoReconnect set to false, and a network-level disconnect. Trace the client’s disconnected and stopped event handling, then compare it with the documented behavior and the suggested client.stop() workaround. Done means the triggering conditions and expected client behavior are clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, javascript, typescript
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.