# AsyncMqttClient (vendored, patched) This is a copy of the library kept in the repo, not downloaded at build time. PlatformIO builds it from `lib/` automatically. Do not add it back to `lib_deps`. | | | |---|---| | Upstream | https://github.com/marvinroger/async-mqtt-client | | Commit | `3d93fc7f662e65366f8e2b0d88b108f874f035b9` (2024-09-25, "Merge pull request #310") | | Copied | `src/`, `LICENSE`, `library.json` (dependencies removed — AsyncTCP comes from `lib_deps`) | | Version | `0.9.0+vesper.1` | ## Why vendored 1. We patch it (below). 2. It used to come from the repo's default branch with no pin, so any upstream push could change the firmware on the next clean build. Upstream is unmaintained, so updates are unlikely, but a copy here means nothing changes unless someone changes it in a commit. ## Patches Every patched line is marked `[vesper patch]` — `grep -rn "vesper patch" lib/AsyncMqttClient`. 1. **`_onPubAck()` / `_onPubComp()` call `_handleQueue()`.** The outbound queue is sent strictly in order and stops after each QoS 1/2 PUBLISH until its acknowledgement arrives. Upstream releases the packet on the ack but doesn't restart sending, so the next queued packet waited for the next lwIP poll (~500 ms). Every QoS 1 message therefore delayed whatever was behind it by a round trip plus up to half a second. Now it's just the round trip. See feature catalog F-072/F-073. ## Updating Don't just copy a newer upstream over this folder. Diff upstream against the commit above, re-apply the patches, bump the `+vesper.N` suffix in `library.json`, update this file, and test MQTT on hardware.