Skip to content

Fix region command whitespace parsing#3016

Open
axhoff wants to merge 1 commit into
meshcore-dev:mainfrom
axhoff:agent/fix-region-default-whitespace
Open

Fix region command whitespace parsing#3016
axhoff wants to merge 1 commit into
meshcore-dev:mainfrom
axhoff:agent/fix-region-default-whitespace

Conversation

@axhoff

@axhoff axhoff commented Jul 21, 2026

Copy link
Copy Markdown

Summary

  • ignore empty fields caused by repeated or trailing spaces in region commands
  • preserve the existing parser API and behavior for every other command
  • add regression coverage for trailing spaces, repeated spaces around a region name, and explicit <null>

Root cause

The generic text splitter preserves empty fields. For region default , that produced an empty third argument. findByNamePrefix("") then matched the last region in the table, after which the default-region handler also cleared its deny-flood flag and persisted the change.

Region commands now opt into a separately named splitter that ignores empty separator fields. Bare region default, including trailing spaces, remains the documented read-only query. Clearing the default remains explicit: region default <null>.

The original four-argument Utils::parseTextParts symbol and behavior are unchanged.

Impact

Trailing or repeated spaces can no longer select a region accidentally, change its flood policy, or persist an unintended default scope.

Fixes #2992

Validation

  • native test binary: 9/9 tests passed
  • pio test -e native
  • pio run -e RAK_4631_repeater
  • pio run -e Station_G2_repeater
  • git diff --check
  • adversarial review: final ship recommendation after preserving the original parser ABI

@axhoff
axhoff marked this pull request as ready for review July 21, 2026 16:42
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.

region default command unexpected results

1 participant