Skip to content

fix: resend want_config when a restarting radio misses it - #1018

Merged
ianmcorvidae merged 1 commit into
masterfrom
fix/resend-want-config
Nov 20, 2026
Merged

ianmcorvidae merged 1 commit into
masterfrom
fix/resend-want-config

Conversation

@jamesarich

@jamesarich jamesarich commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

A radio that is restarting when a client connects can drop the client's one want_config and then never send its config, so _waitConnected waits out its full 30 s whatever timeout the interface was given. On a Heltec V3 (ESP32-S3, 2.8.3) a SerialInterface opened about 4 s after a reboot(3) hung like this 6 times in 20; every stack sat in _waitConnected.

_waitConnected now sends want_config again every 3 s while myInfo is still unset. Once the radio has started answering, a slow node DB download is left alone, and the 30 s default is unchanged. With the same resend in place in meshtastic-mcp, the 20-cycle repro went from 6 hangs to none.

Summary by CodeRabbit

  • Bug Fixes
    • Improved connection reliability by retrying configuration requests when the device hasn’t responded, while preserving the original connection timeout.
    • Avoided restarting configuration downloads when a response has already arrived.

A radio that is restarting when a client connects can drop the one
want_config the client sends, and never sends its config. _waitConnected
then waits out its full 30 s. While nothing of the config has arrived,
send want_config again every 3 s.
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

_waitConnected now waits in intervals of up to three seconds and resends configuration if myInfo has not arrived. It retains the existing timeout behavior and noProto guard. Tests cover retries and a timeout after myInfo arrives.

Changes: Connection configuration retry

Layer / File(s) Summary
Retry behavior and validation
meshtastic/mesh_interface.py, meshtastic/tests/test_mesh_interface.py
_waitConnected uses a three-second retry interval and resends configuration while myInfo is absent. Tests verify that retries can establish a connection and that configuration is not restarted when myInfo is already populated.

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

Change: Bug fix

Suggested reviewers: ianmcorvidae

Merge Risk: Low · up to 84bc0

The change resends the configuration request every 3 seconds while a restarting radio has not answered, which fixes the reported 30-second hang. A very narrow timing window remains in which a retry could clear download state that has just completed. It is unlikely to occur and self-recovers in the partial case, so the PR is mergeable with owner awareness.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: _waitConnected now resends want_config when a restarting radio misses the first request. The raw summary confirms this: configuration is resent every 3 seconds while m…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: _waitConnected now resends want_config when a restarting radio misses the first request. The raw summary confirms this: configuration is resent every 3 seconds while myInfo is unset. The title is specific and matches the PR objective, so it passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Additional comments: 1

meshtastic/mesh_interface.py-1151-1151: 1

1151-1151: Minor · Stability & Availability · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Do not reset a download that completes after the retry check.

After Line 1149 observes myInfo is None, the reader thread can complete the download and set isConnected. This call then clears myInfo, the node dictionaries and _localChannels. Because _startConfig does not clear isConnected, the next wait returns with cleared download state. (raw.githubusercontent.com)

Separate retransmission from destructive initialization, or synchronize retry initiation with incoming config handling. Preserve retries when no response has arrived.

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8f26120 and 84bc0e4.

Files selected for processing: 2

  • meshtastic/mesh_interface.py
  • meshtastic/tests/test_mesh_interface.py

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@ianmcorvidae
ianmcorvidae added this pull request to the merge queue Nov 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2026
@ianmcorvidae
ianmcorvidae merged commit bb126ed into master Nov 20, 2026
13 checks passed
@ianmcorvidae
ianmcorvidae deleted the fix/resend-want-config branch November 20, 2026 19:23
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.

2 participants