Address issues in InMemorySubscriber#141
Conversation
The subscribe API is not idempotent and we fixed unsubscribe() so that there is no issue where we unsubscribe but an handler or listener stays registered. #140
|
Code coverage report is ready! 📈
|
src/main/java/org/eclipse/uprotocol/communication/InMemorySubscriber.java
Outdated
Show resolved
Hide resolved
src/main/java/org/eclipse/uprotocol/communication/InMemorySubscriber.java
Outdated
Show resolved
Hide resolved
src/main/java/org/eclipse/uprotocol/communication/InMemorySubscriber.java
Outdated
Show resolved
Hide resolved
src/main/java/org/eclipse/uprotocol/communication/InMemorySubscriber.java
Outdated
Show resolved
Hide resolved
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
src/main/java/org/eclipse/uprotocol/communication/InMemorySubscriber.java
Outdated
Show resolved
Hide resolved
sophokles73
left a comment
There was a problem hiding this comment.
When in line 130 of InMemorySuscriber the transport.registerListener(topic, listener) call fails, then we have successfully (logically) subscribed to the topic (using USubscription) but have failed to register the listener and return an exception back to the client.
IMHO this is not a real problem as it only means that we might start forwarding events to the local authority which are not being consumed. It might be worth adding a corresponding comment to the code so that anybody reading it knows that we are aware of this and considered it unproblematic.
src/main/java/org/eclipse/uprotocol/communication/InMemorySubscriber.java
Outdated
Show resolved
Hide resolved
we will remove the handler regardless if the unregisterListener is successful or not and when we call unsubscribe or we call unregisterListener() API. Also keeping support for the handler to be used for other state transitions.
|
Code coverage report is ready! 📈
|
|
Code coverage report is ready! 📈
|
The subscribe API is now idempotent and we fixed unsubscribe() so that there is no issue where we unsubscribe but an handler or listener stays registered.
#140