Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(resubscribe): message id allocate twice (#1337)
* fix: messageeId * Fix messageId allocate twice on deliver. resubscribe is out of MQTT spec. It is MQTT.js expansion. On connect sequence, the following three steps are defined by the MQTT Spec. 1. The client sends CONNECT to the broker with CleanStart:false 2. The broker sends CONNACK to the client with SessionPresent:true if session exists 3. The client re-sends in-flight PUBLISH and PUBREL messages resubscribe was processed between the step 2 and step 3. It's too early. The resubscribe might allocate messageId that is the same as PUBLISH or PUBREL packet. It is not good. So I moved resubscribe process to after the step 3. * Removed invalid fallback code. * Stored CONNACK packet instead of sessionPresent. Co-authored-by: Yoseph Maguire <[email protected]>
- Loading branch information