SignalR / SignalR

Incredibly simple real-time web for .NET
http://signalr.net
Other
9.21k stars 2.28k forks source link

Version 2.4.3 released to npm has bug in off function #4729

Open Madajevas opened 1 day ago

Madajevas commented 1 day ago

In repository correct callback index is used when removing handler: https://github.com/SignalR/SignalR/blob/336c877743924c990aeefc75930d63e609e624ac/src/Microsoft.AspNet.SignalR.JS/jquery.signalR.hubs.js#L190-L205

In NPM, however, i from loop above is used, which at the time of removal points at last element of handlers array:

image

https://www.npmjs.com/package/signalr?activeTab=code

Expected behavior

Calling off on hub proxy removes correct handler

Actual behavior

Call off removes nothing. Handler is still being called

Steps to reproduce

BrennanConroy commented 1 day ago

It was fixed in https://github.com/SignalR/SignalR/pull/4659 which will be in 2.4.4