fix: set MQTT sessionPresent from cleanSession flag and stored session state (#6889) - #6894
fix: set MQTT sessionPresent from cleanSession flag and stored session state (#6889)#6894lll-peanut wants to merge 4 commits into
Conversation
|
Good fix — the hardcoded Subscription resume loses QoS. Clean-session state leaks on graceful DISCONNECT (dead-code cleanup). As the PR body notes, Minor (pre-existing, now more reachable): |
Store MQTT session subscriptions with their QoS and resume them through the QoS-aware subscribe repository path. Dispatch DISCONNECT in MqttFactory so clean-session state is removed on graceful disconnect, and unregister disconnected channels from subscriptions. Use computeIfAbsent in SubscribeRepository to avoid concurrent subscribe/resume overwrites.
Thanks for the review. I addressed the three points:
I also added a guard return after rejecting unsupported protocol versions to avoid continuing through authentication/session setup after sending the CONNACK rejection. |
fix: #6889
DISCONNECT is now dispatched by MqttFactory, so clean-session sessions are removed on graceful disconnect; the disconnected channel is also removed from SubscribeRepository while persistent session state is kept for resume.
Make sure that:
./mvnw clean install -Dmaven.javadoc.skip=true.