Closed BillyGeat closed 6 years ago
What version of thruway.js are you using? If it's not sending back an unsubscribe message, then it's most likely a bug.
A npm list
gives "thruway.js@1.3.0-beta5". I think, this should be the last / newest one, right?
I'm able to confirm that this is a bug. I'll have a fix for it later today.
I just updated thruway.js to 1.3.0-beta6 and it works as expected! Thank you for the quick fix!
I saw in the changed files, you mainly added a delay of 100ms before sending the close socket commands. These 100ms should be enough for near every situation? Why are they needed at all?
When the topic is disposed (with takeUntil), it automatically closes the websocket connection if there are 0 subscribers. I added the delay to ensure that the connection is held open long enough to send messages that originate within a dispose, since they happen "out of band".
Hello,
subscribed successfully to a topic and getting messages from server into the angular app.
Now, after "successfully" unsubscribing via the "takeUntil" trick in Angular, no more messages arrive in the App, but the server still sends the subscribed topic. There is / was no code "34" for unsubscribe send to the server by thruway.js.
The code looks like this: ("Angular unsubscribe" from here: https://stackoverflow.com/questions/38008334/angular-rxjs-when-should-i-unsubscribe-from-subscription/41177163#41177163)
How to send an "unsubscribe" also to the server? Am I missing something?