Skip to content

fix(cli): drop duplicate dc.gate handlers that shadowed the on/off fix - #13

Merged
Elektr0Vodka merged 1 commit into
dmc-observer-devfrom
fix/dmc-observer-dev-dc-gate-dup-handlers
Sep 26, 2026
Merged

Elektr0Vodka merged 1 commit into
dmc-observer-devfrom
fix/dmc-observer-dev-dc-gate-dup-handlers

Conversation

@Elektr0Vodka

Copy link
Copy Markdown

Follow-up to #10. On dmc-observer-dev, set dc.gate on still disables duty-cycle region gating, even though #9/#10 fixed the parser.

Problem

src/helpers/CommonCLI.cpp on the observer contains the dc.gate / dc.gate.thresh / dc.gate.hyst set handlers twice in the same else if chain, and the three get readbacks twice as well. This is a leftover from the 2026-09-11 dmc-dev → observer merge (the same merge that duplicated the docs chapter #10 removed).

  • The first copy, right after handleObserverSetCmd, is the observer's original and still does dc_gate_enabled = atoi(...) != 0.
  • The second copy, after allow.read.only, came from dmc-dev and has the on/off fix.

The first copy matches first, so the fix is dead code. set dc.gate on replies OK and turns gating off. 1/0 work, which is why the Toolbox is unaffected. dmc-dev has each handler only once and is not affected.

Found while verifying the observer-mqtt-dev 9805406 release notes; that release lists this as a known issue.

Change

Remove the observer-original copy (set + get, 34 lines) and keep the copy that is identical to dmc-dev. The set and get chains now match dmc-dev line for line, so future dmc-dev merges into the observer won't conflict on these lines again. handleObserverSetCmd / handleObserverGetCmd don't handle any dc.gate key, so nothing earlier in the chain intercepts them.

Testing

  • pio run -e heltec_v4_repeater_observer_mqtt, heltec_v4_room_server_observer_mqtt and RAK_4631_repeater build.
  • Diffed the allow.read.only → dc.gate set/get chains against origin/dmc-dev: identical.
  • Not tested on a device. CommonCLI.cpp isn't reachable from the native test envs.

🤖 Generated with Claude Code

CommonCLI.cpp on dmc-observer-dev carried the dc.gate / dc.gate.thresh /
dc.gate.hyst set handlers (and their get readbacks) twice, a leftover of
the 2026-09-11 dmc-dev merge. The first copy, right after the observer
hook, still parsed dc.gate with atoi(), and since it matches first the
on/off fix from #9/#10 in the second copy was dead code: `set dc.gate on`
still replied OK and disabled region gating.

Remove the observer-original copy and keep the one that is identical to
dmc-dev, so the set/get chains match dmc-dev line for line and future
dmc-dev merges stay conflict-free.
@Elektr0Vodka
Elektr0Vodka merged commit 923fc42 into dmc-observer-dev Sep 26, 2026
1 check passed
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