Found in the PR #170 review, with a failing test.
Defect: on Clean Start=1, the in-browser broker (crates/mqtt5-wasm/src/client_handler/connect.rs handle_session) deletes the stored session but never removes the ClientID's router subscriptions. The native broker does this in register_session(clean_start).
This violates [MQTT-3.1.2-4]: the previous session must be discarded.
Effect: connect with a persistent session, subscribe, disconnect, then reconnect with Clean Start=1. The client gets Session Present=0 but still receives messages on the old topic.
Found in the PR #170 review, with a failing test.
Defect: on Clean Start=1, the in-browser broker (
crates/mqtt5-wasm/src/client_handler/connect.rshandle_session) deletes the stored session but never removes the ClientID's router subscriptions. The native broker does this inregister_session(clean_start).This violates
[MQTT-3.1.2-4]: the previous session must be discarded.Effect: connect with a persistent session, subscribe, disconnect, then reconnect with Clean Start=1. The client gets Session Present=0 but still receives messages on the old topic.