stomp-js / rx-stomp

STOMP adaptor for RxJS
Apache License 2.0
112 stars 21 forks source link

`deactivate` Promise never resolves #445

Closed onethread closed 1 year ago

onethread commented 2 years ago

I'm doing something like so:

await rxStomp.deactivate();

But the Promise takes a long time to resolve (around 10 minutes). After I resolve, I call activate again, but I get the following error: Error: Still DEACTIVATING, can not activate now, which seems to imply that onWebSocketClose was not called, which should have changed the state from DEACTIVATING to INACTIVE.

I'm on version 1.1.4 of @stomp/rx-stomp.

kum-deepak commented 2 years ago

Thanks for the report. I will investigate it further. Please attach the complete console output.

onethread commented 2 years ago

Fwiw, after some more testing, it seems to be an underlying issue with stompjs. I rolled back to stompjs 5.x, and it worked fine (Promise is not an option). The work around for stompjs 6.x seems to be: don't await, spin up a new instance of RxStomp if I need to connect again.

I'll get some logs!

kum-deepak commented 2 years ago

Looking at the code, I think I know the source of the error. Please attach the console output that will help me in confirming my conjecture,

kum-deepak commented 1 year ago

The deactivate logic in the next version of stompjs is getting updated. It should probably resolve this issue.

kum-deepak commented 1 year ago

I just now released @stomp/rx-stomp@2.0.0-beta1. Please check if it resolves the issue.

kum-deepak commented 1 year ago

Released v2.0.0