vertx-stomp icon indicating copy to clipboard operation
vertx-stomp copied to clipboard

Subscription removed from StompClientConnectionImpl cache even before sending UNSUBSCRIBE frame

Open saiskk opened this issue 5 months ago • 2 comments

Questions

Do not use this issue tracker to ask questions, instead use one of these channels. Questions will likely be closed without notice.

Version

Which version(s) did you encounter this bug ? 4.4.5

Context

In StompClientConnectionImpl class when an unsubscribe call is received, it is removed from client cache "List<Subscription> subscriptions" before sending the UNSUBSCRIBE frame. When this call is failed at server side, client cache doesn't have the subscription due to which we are receiving events and we cannot make another unsubscribe call as StompClientConnectionImpl would return an IllegalArgumentException

https://github.com/vert-x3/vertx-stomp/blob/55227790cb75f13cbcda764cc269efa02da652ae/src/main/java/io/vertx/ext/stomp/impl/StompClientConnectionImpl.java#L357-L361

Same goes for subscribe as well. https://github.com/vert-x3/vertx-stomp/blob/55227790cb75f13cbcda764cc269efa02da652ae/src/main/java/io/vertx/ext/stomp/impl/StompClientConnectionImpl.java#L313-L326

saiskk avatar Jan 10 '24 15:01 saiskk

do you have a reproducer for this ?

vietj avatar Jan 10 '24 15:01 vietj

Nope I'll try to create a test case for it. Fix would be adding the subscription in cache after sending SUBSCRIBE/UNSUBSCRIBE frame, so haven't thought of reproducer.

saiskk avatar Jan 10 '24 15:01 saiskk