You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(resubscribe): message id allocate twice (mqttjs#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 <yoseph.maguire@gmail.com>
0 commit comments