RicoSuter / SigSpec

Specification and code generator for SignalR Core.
MIT License
159 stars 37 forks source link

The "unregisterCallbacks" method is not working #26

Open henczi opened 4 years ago

henczi commented 4 years ago

The registerCallbacks and the unregisterCallbacks methods always create a new function for the handlers, therefore the unregistration process will not work (because the comparison in the HubConnection's off method is reference-based).

https://github.com/dotnet/aspnetcore/blob/master/src/SignalR/clients/ts/signalr/src/HubConnection.ts#L460

Related PR: https://github.com/RicoSuter/SigSpec/pull/22

RicoSuter commented 4 years ago

I agree, this cannot work.

/cc @beorosz

beorosz commented 4 years ago

Let me take a look.

RicoSuter commented 4 years ago

Probably we need to change the way we register/unregister... (but we need to ensure that this still works correctly on the implementation).

beorosz commented 4 years ago

Okay, I started to work on this.