Description
The CONNACK session-present flag is hard-coded true for every connection, including the very first connect and clients with the clean-session flag set. Combined with the complete absence of session-state persistence (Disconnect.cleanChannel only touches ChannelRepository; Disconnect.java:39 carries // todo Clean session), the broker actively lies about stored session state.
Location
shenyu-protocol/shenyu-protocol-mqtt/src/main/java/org/apache/shenyu/protocol/mqtt/Connect.java:72
Impact
Violates MQTT-3.2.2-6/7. A client reconnecting with cleanSession=1 is told a session was present (must be 0); a first-time client is told the same.
Suggested fix
Set sessionPresent from the connect-flags cleanSession bit and stored session state (false when cleanSession=1 or no prior session).
Related existing
None.
Description
The CONNACK session-present flag is hard-coded
truefor every connection, including the very first connect and clients with the clean-session flag set. Combined with the complete absence of session-state persistence (Disconnect.cleanChannelonly touchesChannelRepository;Disconnect.java:39carries// todo Clean session), the broker actively lies about stored session state.Location
shenyu-protocol/shenyu-protocol-mqtt/src/main/java/org/apache/shenyu/protocol/mqtt/Connect.java:72Impact
Violates MQTT-3.2.2-6/7. A client reconnecting with
cleanSession=1is told a session was present (must be0); a first-time client is told the same.Suggested fix
Set
sessionPresentfrom the connect-flagscleanSessionbit and stored session state (false whencleanSession=1or no prior session).Related existing
None.