You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is using the count of subscribes as a property index to register a new subscriber. That will then break future subscribers if anyone but the most recent subscriber unsubscribes.
As an example scenario:
Subscriber A subscribes to the client and gets assigned ID 0
Subscriber B subscribes to the client and gets assigned ID 1
Subscriber A unsubscribes. The count of subscribers is now 1
Subscriber C subscribes to the client and gets assigned ID 1... again. Subscriber B no longer gets notifications.
Subscriber D subscribes to the client and gets assigned ID 1... again... again. Subscriber C no longer gets notifications.
etc...
The client implementation could keep the public facing API it has but internally use a CustomEvent object to store the subscribed handlers to avoid managing the subscriptions itself.
The text was updated successfully, but these errors were encountered:
The Client subscribe method has an bug in how it internally stores the handles to registered subscribers. The code starts like this:
It is using the count of subscribes as a property index to register a new subscriber. That will then break future subscribers if anyone but the most recent subscriber unsubscribes.
As an example scenario:
The client implementation could keep the public facing API it has but internally use a CustomEvent object to store the subscribed handlers to avoid managing the subscriptions itself.
The text was updated successfully, but these errors were encountered: