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
We ran into a issue over at home-assistant/core#8315 where users were getting errors after upgrading the mqtt client. I did a bit of digging on the subject and I think there is a bug in hbmqtt's implementation of version 3.1.1 of the MQTT protocol. It appears that 3.1.1 allows for clients to send a zero length client id to the server, and according to the spec:
A Server MAY allow a Client to supply a ClientId that has a length of zero bytes, however if it does so the Server MUST treat this as a special case and assign a unique ClientId to that Client. It MUST then process the CONNECT packet as if the Client had provided that unique ClientId
It appears when getting the handler in the broker [1] it checks if client_id is True, but it's a zero length string, so the function returns None.
I think there are two options here, refuse zero length client ids, or generate a random_id and store that for later use.
The text was updated successfully, but these errors were encountered:
Are there design doc anywhere? I'm trying to wrap my head around what's going on, but there a few places ([1] [2]) where variable names are not clear. My current question is what does "parent" mean on an instance of a Session class? It appears that if we can't find a cached session [3], then we should do the same client_id gen that's done here [4].
We ran into a issue over at home-assistant/core#8315 where users were getting errors after upgrading the mqtt client. I did a bit of digging on the subject and I think there is a bug in hbmqtt's implementation of version 3.1.1 of the MQTT protocol. It appears that 3.1.1 allows for clients to send a zero length client id to the server, and according to the spec:
It appears when getting the handler in the broker [1] it checks if client_id is True, but it's a zero length string, so the function returns None.
I think there are two options here, refuse zero length client ids, or generate a random_id and store that for later use.
The text was updated successfully, but these errors were encountered: