mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-04-30 07:59:40 +00:00
This changes the clean_session default to false, as only in case of a persistent session, qos > 0 would be effective. If the client_id is not set, then ChirpStack will generate a random client_id, which stays the same during the lifetime of the chirpstack process. This also implements a subscribe loop, as the client re-connect feature does not re-subscribe. Even in case of a persistent session there is no guarantee that the subscription is recovered, as it might have been a MQTT broker restart. In case the broker stores the sessions in-memory, the client would re-connect, but without subscriptions. The (re)subscribe logic is placed outside the on-connected callback, as the callback function must not block, thus can not wait for the subscribe result. No the (re)subscribe happens async from the on-connected.