espressif / esp-mqtt

ESP32 mqtt component
Apache License 2.0
611 stars 257 forks source link

When MQTT_REPORT_DELETED_MESSAGES, delete QOS messages with id 0 (IDFGH-14022) #290

Closed Totrasmek closed 1 week ago

Totrasmek commented 2 weeks ago

Description

Fixes #289 When my outbox has only QOS0 messages, I receive no MQTT_EVENT_DELETED posted to the event handler, and only the first message in the outbox is deleted if it has been in the outbox > OUTBOX_EXPIRED_TIMEOUT_MS.

This is because QOS0 messages are given a msg_id of 0 and mqtt_delete_expired_messages stops deleting outbox items once their msg_id is 0.

This change allows messages with ids of 0 to be deleted as well.

Testing

Tested as described in the github issue.

Checklist

Before submitting a Pull Request, please ensure the following: