eclipse-paho / eclipse-paho/paho.mqtt.java
Disconnected Buffer is not cleared when cleansession is true
- Dominant language
- Java
- Stars
- 2.3k
- Forks
- 919
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I am using Paho library for my android app and I am facing an issue related to offline buffering of messages.
When cleansession is true, `MqttClientPersistence` is cleared when client reconnects but the disconnected buffer is not cleared. This creates inconsistent behaviour.
- When client reconnects in the same session, messages are sent from the disconnected buffer
- When client reconnects on process restart, no messages are sent as the persistence is cleared due to cleansession.
- [x] Bug exists Release Version 1.2.5 ( Master Branch)
- [x] Bug exists in MQTTv3 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)
- [x] Bug exists in MQTTv5 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)
If this is a bug regarding the Android Service, please raise the bug here instead: https://github.com/eclipse/paho.mqtt.android/issues/new
Contributor guide
Research direction
Start by tracing the MQTTv3 and MQTTv5 reconnect paths that handle the disconnected buffer and MqttClientPersistence. Reproduce both cases described: reconnect in the same session and reconnect after a process restart with cleansession true; done means the disconnected buffer is cleared consistently with persistence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100