Reconnect and QoS

Hi, I’m using libmosquitto with Solace MQTT broker, MQTTv5. Works great except for when the Solace brokers are restarted for any reason. When reconnecting the same session, Solace seems to accept new connections prematurely often returns CONNACK with reason code 133 “Client Identifier not valid”, when this happens also property 36, MQTT_PROP_MAXIMUM_QOS, is passed with value zero. If I disconnect, and tries to reconnect on a random backoff this property is never sent again, even when CONNACK reason_code is MQTT_RC_SUCCESS.

The MQTTv5 standard allows this, only QoS 0 or 1 needs to be sent, else 2 is assumed. However, the value max_qos in the opaque struct is never reset to 2. Setting it to 2 before reading the properties in lib/handle_connack.c would fix the problem. Where I am now, all I can do is assert(reason_code != MOSQ_ERR_QOS_NOT_SUPPORTED) which is safe but hardly ideal, at least not pretty in the Grafana logs :stuck_out_tongue:.
Any suggestions/better way to go about this than making changes in my copy of libmosquitto?