Skip to content

phoneapi: send status message config - #11129

Merged
thebentern merged 4 commits into
meshtastic:developfrom
RCGV1:agent/include-statusmessage-config
Jul 22, 2026
Merged

phoneapi: send status message config#11129
thebentern merged 4 commits into
meshtastic:developfrom
RCGV1:agent/include-statusmessage-config

Conversation

@RCGV1

@RCGV1 RCGV1 commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

  • include StatusMessage in the module-config stream sent by want_config
  • add a focused PhoneAPI config-stream regression test

Why

PhoneAPI iterates the StatusMessage tag but previously treated it as unhandled, so clients did not receive the local node status on their initial config download.

Fixes #11127

Validation

  • pio test -e native-macos -f test_stream_api — 13 passed
  • pio run -e native-macos
  • started meshtasticd -s with an isolated temporary VFS for five seconds
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes
    • Fixed configuration responses so “want config” requests now correctly include the status message module configuration.
    • Special configuration requests now return the expected node status details for the status message module.
  • Tests
    • Added a regression test that encodes and verifies the status message module configuration (including node status) in configuration responses.

@CLAassistant

CLAassistant commented Jul 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b5ecf47e-9ba2-42fa-ae7d-9c63c1565d87

📥 Commits

Reviewing files that changed from the base of the PR and between 91915a0 and 566d95f.

📒 Files selected for processing (1)
  • test/test_stream_api/test_main.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/test_stream_api/test_main.cpp

📝 Walkthrough

Walkthrough

PhoneAPI now includes the StatusMessage module configuration in want_config responses. A stream API regression test verifies the serialized configuration contains the expected node status.

Changes

StatusMessage config streaming

Layer / File(s) Summary
Emit StatusMessage module config
src/mesh/PhoneAPI.cpp
PhoneAPI::getFromRadio() serializes the StatusMessage module configuration into the response.
Validate want_config response
test/test_stream_api/test_main.cpp
Adds a connected transport shim and regression test that sends a configuration request, decodes the response, and verifies the StatusMessage module entry.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Test as want_config test
  participant PhoneAPI as PhoneAPI::getFromRadio
  participant FromRadio
  Test->>PhoneAPI: send want_config request
  PhoneAPI->>FromRadio: emit ModuleConfig_statusmessage
  FromRadio-->>Test: decode node_status
Loading

Suggested labels: enhancement

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title concisely and accurately summarizes the main change: adding StatusMessage config handling in PhoneAPI.
Description check ✅ Passed The description includes summary, motivation, linked fix, and validation; only the optional attestation checklist is not filled out.
Linked Issues check ✅ Passed The change adds StatusMessage to the want_config module-config stream and adds a regression test, matching #11127.
Out of Scope Changes check ✅ Passed The PR stays focused on the config-stream fix and its regression test with no unrelated code changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@RCGV1
RCGV1 marked this pull request as ready for review July 21, 2026 17:07
@RCGV1
RCGV1 force-pushed the agent/include-statusmessage-config branch from 00a4de9 to 91915a0 Compare July 21, 2026 17:11

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
test/test_stream_api/test_main.cpp (1)

494-494: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider explicitly null-terminating the string buffer.

While "Ready" easily fits and moduleConfig starts zero-initialized, strncpy stops padding at the specified limit and leaves the byte at [sizeof(...) - 1] completely untouched. Explicitly setting the final byte to \0 is a good defensive practice to prevent non-null-terminated string bugs if this test code is ever modified to use longer strings or uninitialized buffers. This also aligns with the upstream idiom used in StatusMessageModule.cpp.

♻️ Proposed refactor
-    strncpy(moduleConfig.statusmessage.node_status, "Ready", sizeof(moduleConfig.statusmessage.node_status) - 1);
+    strncpy(moduleConfig.statusmessage.node_status, "Ready", sizeof(moduleConfig.statusmessage.node_status) - 1);
+    moduleConfig.statusmessage.node_status[sizeof(moduleConfig.statusmessage.node_status) - 1] = '\0';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/test_stream_api/test_main.cpp` at line 494, Explicitly set the final
byte of moduleConfig.statusmessage.node_status to '\0' immediately after the
strncpy call, using the buffer’s last index to guarantee null termination even
if the source string or initialization changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@test/test_stream_api/test_main.cpp`:
- Line 494: Explicitly set the final byte of
moduleConfig.statusmessage.node_status to '\0' immediately after the strncpy
call, using the buffer’s last index to guarantee null termination even if the
source string or initialization changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 15be2815-21d1-4ab1-af9e-9658dec55d1e

📥 Commits

Reviewing files that changed from the base of the PR and between 5548bd3 and 00a4de9.

📒 Files selected for processing (2)
  • src/mesh/PhoneAPI.cpp
  • test/test_stream_api/test_main.cpp

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Flash this PR in the Web Flasher

firmware commit boards expires

Warning

This is an automated, unreviewed CI test build. Back up your device configuration
before flashing, and only flash devices you are able to recover.

Supported boards built by this PR (30)
Device Board Platform
Crowpanel Adv 3.5 TFT elecrow-adv-35-tft esp32-s3
Heltec HT62 heltec-ht62-esp32c3-sx1262 esp32-c3
Heltec Mesh Node 096 heltec-mesh-node-t096 nrf52840
Heltec Mesh Node T1 heltec-mesh-node-t1 nrf52840
Heltec Mesh Node T114 heltec-mesh-node-t114 nrf52840
Heltec V3 heltec-v3 esp32-s3
Heltec V4 heltec-v4 esp32-s3
Meshnology W10 meshnology_w10 esp32-s3
Raspberry Pi Pico pico rp2040
Raspberry Pi Pico W picow rp2040
RAK WisMesh Pocket V3 rak_wismesh_pocket nrf52840
RAK WisMesh Pod rak_wismesh_pod nrf52840
RAK WisMesh Repeater Mini V2 rak_wismesh_repeater_mini nrf52840
RAK WisMesh Tag rak_wismeshtag nrf52840
RAK WisBlock 11200 rak11200 esp32
RAK WisBlock 11310 rak11310 rp2040
RAK3312 rak3312 esp32-s3
RAK WisBlock 4631 rak4631 nrf52840
Seeed SenseCAP Mesh-Tracker-X1 seeed_mesh_tracker_X1 nrf52840
Seeed Wio Tracker L1 seeed_wio_tracker_L1 nrf52840
Seeed Xiao NRF52840 Kit seeed_xiao_nrf52840_kit nrf52840
Seeed Xiao ESP32-S3 seeed-xiao-s3 esp32-s3
Station G2 station-g2 esp32-s3
Station G3 station-g3 esp32-s3
LILYGO T-Deck t-deck-tft esp32-s3
LILYGO T-Echo t-echo nrf52840
LILYGO T-Echo Plus t-echo-plus nrf52840
LILYGO T-Impulse Plus t-impulse-plus nrf52840
LilyGo T3-C6 tlora-c6 esp32-c6
Seeed SenseCAP T1000-E tracker-t1000-e nrf52840

Build artifacts expire on 2026-08-20. Updated for df971c2.

@thebentern thebentern added the bugfix Pull request that fixes bugs label Jul 22, 2026
@thebentern
thebentern merged commit 5e3d1ea into meshtastic:develop Jul 22, 2026
103 of 104 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include StatusMessage module config in the want_config config download

3 participants