davinkevin / AngularStompDK

Angular service to communicate to Stomp-Websocket
http://davinkevin.github.io/AngularStompDK/
Apache License 2.0
36 stars 12 forks source link

Multiple subscriptions to the same topic after reconnect #30

Closed baczus closed 8 years ago

baczus commented 8 years ago

Hi, I noticed that after each reconnect, library connects to the same topic multiple times. To be more clear. After first reconnect we have two subscriptions, after second reconnect four subscriptions and so on. I think this is related to changes made in 9898775 and fact that after reconnect, library executes $$addToConnectionQueue function: $reconnectAll() -> this.subscribe() -> this.$stompSubscribe() -> this.$$addToConnectionQueue()

davinkevin commented 8 years ago

Ok, I'll try to solve it.

And it seems the reconnectAll doesn't remove all the subscriptions before "reconnecting everything". I think, reseting the this.connection array could be the simple way to solve it.

If you want, you can do a Pull request :+1:

davinkevin commented 8 years ago

Close by #31