Skip to content

[C] mqttv5 twin: document that desired patches need twin_push.push_desired - #407

Merged
Ewerton Scaboro da Silva (ewertons) merged 2 commits into
mainfrom
fix/mqttv5-twin-push-desired-docs
Oct 10, 2026
Merged

Ewerton Scaboro da Silva (ewertons) merged 2 commits into
mainfrom
fix/mqttv5-twin-push-desired-docs

Conversation

@ewertons

Copy link
Copy Markdown
Contributor

Problem

With twin_push.push_desired = false (the default), the mqttv5 service sends no desired-property patches or version probes. Desired changes made while connected reach the device only on reconnect or after a twin GET. The twin_push comment, the mqttv5 twin client file doc and an internal comment implied patches arrive in either mode.

Changes

  • az_iot_connection_client.h: twin_push doc states what each mode delivers. Default stays false.
  • mqttv5/az_iot_twin_client.h: file doc states patches and probes require push_desired.
  • src/mqttv5/twin_client.c: on_hub_connected comment corrected. No behavior change.
  • docs/connecting.md: twin_push row in MQTT session options.
  • Unit tests: options_default_leaves_twin_push_off, a_get_ahead_fetches_a_snapshot.

Validation

Linux gcc Debug: build clean; ctest 38/38 suites pass.

Not included: live test of pull and push mode desired delivery (no mqttv5 twin e2e scenario exists yet).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The documentation matches existing behavior, and targeted unit tests cover the clarified defaults and synchronization path.

0 open findings

What changed in this PR

Clarifies MQTT v5 twin delivery behavior when desired-property push is disabled.

Changes:

  • Documents pull versus push delivery semantics.
  • Corrects internal connection commentary.
  • Adds unit coverage for defaults and GET-triggered synchronization.
File Description
c/​inc/​azure/​iot/​az_iot_connection_client.h Documents twin push options.
c/​inc/​azure/​iot/​mqttv5/​az_iot_twin_client.h Clarifies desired-state delivery.
c/​src/​mqttv5/​twin_client.c Corrects connection comment.
c/​docs/​connecting.md Adds twin push guidance.
c/​tests/​unit/​connection_client_test.c Tests default push settings.
c/​tests/​unit/​mqttv5_twin_client_test.c Tests GET-triggered snapshot retrieval.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI balanced review requested due to automatic review settings October 10, 2026 07:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The connecting guide incorrectly states that pull mode always fetches a snapshot on connect.

1 open finding

🧠 Review effort: Balanced

Comment thread c/docs/connecting.md Outdated
Copilot AI balanced review requested due to automatic review settings October 10, 2026 07:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The documentation matches the existing implementation, and focused tests verify the clarified behavior.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

…sired

Without push_desired (the default) the service sends no desired patches or
version probes; desired changes made while connected are seen only on
reconnect or after a twin GET. Correct the connection options, twin client
and connecting docs accordingly, and add unit tests for the default and for
a GET that shows desired ahead.
Copilot AI balanced review requested due to automatic review settings October 10, 2026 07:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The documentation matches the implementation, and the relevant default and catch-up behaviors are covered by unit tests.

0 open findings

🧠 Review effort: Balanced

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@ewertons
Ewerton Scaboro da Silva (ewertons) merged commit eb61963 into main Oct 10, 2026
57 checks passed
@ewertons
Ewerton Scaboro da Silva (ewertons) deleted the fix/mqttv5-twin-push-desired-docs branch October 10, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants