Fenrir fixes#554
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes issue f-3626 by ensuring MQTT v5 broker-side rejections of QoS>0 publishes are surfaced to callers (instead of incorrectly returning success), aligning the client’s publish behavior with how other v5 “ACK-but-rejected” flows are reported.
Changes:
- Add a new return code
MQTT_CODE_ERROR_PUBLISH_REJECTEDfor v5 QoS>0 PUBLISH rejections signaled via PUBACK/PUBREC/PUBCOMP reason codes (>= 0x80). - Update client publish handling to (a) stop QoS2 on PUBREC rejection (no illegal PUBREL) and (b) post-check PUBACK/PUBCOMP reason codes after the wait.
- Add unit tests covering QoS1/QoS2 acceptance vs rejection cases (and a v3.1.1 guard).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| wolfmqtt/mqtt_types.h | Introduces the new MQTT_CODE_ERROR_PUBLISH_REJECTED return code. |
| wolfmqtt/mqtt_client.h | Updates public API docs to mention the new publish rejection code (and adds a note about the write-only path). |
| src/mqtt_client.c | Implements publish rejection detection for v5 PUBACK/PUBREC/PUBCOMP and adds string mapping for the new code. |
| tests/test_mqtt_client.c | Adds regression tests validating correct return codes and QoS2 handshake behavior on v5 rejections. |
| ChangeLog.md | Documents the behavior change and its implications for callers, including MT/write-only caveats. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #554
Scan targets checked: wolfmqtt-bugs, wolfmqtt-src
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Findings are non-blocking.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #554
Scan targets checked: wolfmqtt-bugs, wolfmqtt-src
No new issues found in the changed files. ✅
Uh oh!
There was an error while loading. Please reload this page.