"unsubscribed" event is never triggered (with fix)
Open
- Dominant language
- JavaScript
- Stars
- 5k
- Forks
- 454
- PR merge metrics
- No merged PRs in 30d
Description
I'm using WebSocket as the socket mechanism and when the server unexpectedly drops the connection, the "unsubscribed" event is never emitted due to the bug in the following 2 lines:
``` js
this.subscribed = false;
if (this.subscribed) this.emit('unsubscribed'); // never triggered!!
```
located in lib/client/doc.js:407
Here is my fix:
``` js
var wasSubscribed = this.subscribed;
this.subscribed = false;
if (wasSubscribed) this.emit('unsubscribed');
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.