Skip to content

OnDisconnectAsync never called #62745

@daef

Description

@daef

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I am trying to detect disconnected signalr clients. OnDisconnectAsync is never called. If the behavior to not fire OnDisconnectAsync when a debugger is attached (documented only in issues like #18879 but not in the docs?) was configurable it would probably be easier to debug. Who had the genius idea that an undocumented (and not configurable) change in behavior for debug builds makes debugging easier? Sadly it doesn't for me. But even twiddling with the timeout knobs and using release builds doesn't seem to ever trigger a OnDisconnectAsync when the browser window is simply closed.

The network tab reveals pings from the client to the server every few seconds - so the hub should definitely be able to recognize a client with cardiac arrest, i.e. no heartbeat.

Expected Behavior

OnDisconnectAsync is called at last.

.NET Version

9.0.302

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions