Skip to content

Restore command subscriptions after MQTT recovery reconnect - #22

Merged
mot-yelraf merged 1 commit into
trunkfrom
fix-mqtt-reconnect-recovery
Sep 27, 2026
Merged

mot-yelraf merged 1 commit into
trunkfrom
fix-mqtt-reconnect-recovery

Conversation

@mot-yelraf

Copy link
Copy Markdown
Owner

Summary

After a clean-session MQTT recovery reconnect, Nodus could resume telemetry without restoring command subscriptions because recovery reused an already drained subscription queue. Rebuild every device command subscription and schedule switch subscriptions again, while retaining pending publications and the existing publish-before-subscribe order.

Adds regression coverage for empty and partially completed subscription queues and broker-adapter delivery of correlated display config ACK/result responses. Documents recovery validation and updates firmware to v0.26.270.1.

Related issue

Focused fix for the operator-reported co2-pmoopn config/set requests receiving no ACK/result while telemetry continued; no separate issue.

Verification

  • ruff check .: passed.
  • pytest -q: 898 passed.
  • git diff --check: passed.
  • Operator post-restart capture on co2-pmoopn, Pico2 W, sensorius profile, v0.26.270.1: broker-visible matching config/ack, successful config/result, meta/patch, and refreshed meta/config. Operator verified the intended six display metrics and Graph24hr styles in sensor_i2c.toml.
  • This hardware check followed a device restart; it does not validate the recovery reconnect regression. Controlled recovery, partial-subscription recovery, broker restart, and repeated-reconnect soak validation remain outstanding. The procedure is documented in docs/mqtt.md.
  • Hardware test duration and running CircuitPython version were not supplied; the supported Pico2 W baseline is 9.2.8. Successful file persistence was verified, but filesystem mode was not independently captured for this run. Broker software was not identified. No additional resets were reported in the supplied command capture.

Checklist

  • I kept the change focused and avoided unrelated reformatting.
  • I added or updated focused tests when behavior changed.
  • ruff check . passes.
  • pytest -q passes.
  • I updated docs and TOML templates when public behavior or configuration changed. (Docs updated; no schema changes.)
  • I did not commit credentials, live device configuration, private logs, or host-specific files.
  • I preserved CircuitPython compatibility and constrained-memory behavior.
  • I documented relevant hardware validation, or explained why it was not required.
  • I updated the firmware version only if runtime behavior changed.

@mot-yelraf
mot-yelraf merged commit 9ed489a into trunk Sep 27, 2026
5 checks passed
@mot-yelraf
mot-yelraf deleted the fix-mqtt-reconnect-recovery branch September 27, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant