JS client in disconnected event connection state is still connected #2634

Closed
NTaylorMullen opened this Issue Oct 15, 2013 · 1 comment

Projects

None yet

2 participants

@NTaylorMullen

JS client in disconnected event connection state is still connected

Functional impact:
incorrect connection state when it is disconnected

Note, it is not regression.

Repro steps:
1). use AspNet.SignalR.Samples, in HubConnectionAPI.js disconnected event add log for $.connection.hub.state:

    $.connection.hub.disconnected(function () {
        window.console.log("$.connection.hub.state: " + $.connection.hub.state);
        .......
       });

2). request Hubs/HubConnectionAPI/Default.aspx
3). on page, after connected, click "Stop Connection"
4). look the log

Actual result:
in disconnected event connection state is still connected

Expected:
in disconnected event connection state is disconnected
#2554

@NTaylorMullen NTaylorMullen added a commit that referenced this issue Oct 24, 2013
@NTaylorMullen NTaylorMullen Altered when we transition into the disconnected state during connect…
…ion.stop.

- This ensures that when the disconnected handler is called that we're in the disconnected state.
- Removed the try -> finally for this transition because the state transition now occurs prior to anything that would throw.
- Added a simple unit test to ensure that disconnected is triggered while in the disconnected state.

#2634
49c6055
@NTaylorMullen NTaylorMullen added a commit that referenced this issue Oct 25, 2013
@NTaylorMullen NTaylorMullen Altered when we transition into the disconnected state during connect…
…ion.stop.

- This ensures that when the disconnected handler is called that we're in the disconnected state.
- Removed the try -> finally for this transition because the state transition now occurs prior to anything that would throw.
- Added a simple unit test to ensure that disconnected is triggered while in the disconnected state.

#2634
2807faa
@gustavo-armenta

tested disconnected event is raised with connection.state==disconnected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment