You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stop the edit transaction discarding the per-field save decisions
Review of this branch's own output, plus the two findings Copilot raised on
The headline defect is that none of this branch's narrowing reached phone apps.
saveChanges() defers while an edit transaction is open, and radioAffected
defaulted to true, so eight call sites that never thought about the radio - the
five node-DB handlers, set_owner, set_module_config, and the nested save in the
position case - accumulated a true into deferredRadioAffected. Outside a
transaction that was harmless, because reloadConfig()'s
saveWhat & (SEGMENT_CONFIG | SEGMENT_CHANNELS) bitmask independently blocks a
node-DB-only save from reaching the radio whatever it asks for. Inside one the
commit saves under a fixed full mask, so the bitmask always passes and
radioAffected is the only thing left deciding it. Favouriting a node from the
phone app therefore still ran the live SX126x reconfigure at commit - the
The fix is to remove the default from saveChanges() rather than gate the
deferred flag on the segment mask, which is what the review suggested. Gating
would reinstate exactly the segment-to-radio inference this branch exists to
delete - NodeDB.h now carries a comment telling the next person not to do that -
and it fixes the symptom while leaving the wrong default in place for the next
call site. With no default the compiler makes all fourteen sites state the
answer. The commit also consumes and clears the deferred flags, so a stray
second commit cannot inherit the previous transaction's answer.
That gap existed because every radio test ran outside a transaction, which is
the one arrangement where the bug is unreachable. Nine tests now cover the
deferred path, asserting both axes independently across a commit. Verified they
fail against the old behaviour: five go red while every pre-existing test stays
green, which is the point.
requestReboot()'s comment had the semantics backwards - it claimed a negative
delay meant "now" and that rebootAtMsec == 0 was an immediate-reboot sentinel.
Both are inverted: 0 means no reboot pending at every read site, and
admin.proto documents reboot_seconds "<0 to cancel reboot". The expression was a
faithful copy of AdminModule's, so only the comment was wrong, but it was wrong
on the newly-created central helper. The negative branch now says so and logs
it. Five sites still open-coded the deadline despite that helper existing; they
are pure reboots with no config save, so applyConfigChange() does not fit but
requestReboot() does exactly.
SET_SMART_BROADCAST_INTERVAL was the only CONFIG_APPLY_REBOOT site in the InkHUD
menu without a notifyApplyingChanges() beside it - re-adding its reboot last
commit dropped the warning that applyConfigReload() used to raise, so the e-ink
would go dark unannounced. And four channel actions carried CONFIG_APPLY_RADIO
for uplink/downlink and position_precision, none of which touch the name, PSK or
frequency slot the radio derives anything from; they had it only because the old
reloadConfig(SEGMENT_CHANNELS) inferred it from the bitmask.
The doc had gone stale inside its own PR again: it still listed
commit_edit_settings under "intentionally left unchanged". Replaced with a
section on why the bitmask stops protecting you inside a transaction, since that
is the non-obvious part. Also dropped a commit SHA that had already been
orphaned by rebase, exactly as its own note predicted, and a stale plan-doc
reference in the tests that the last doc pass missed.
Full native suite green, 810 cases across 40 suites. t-echo and t-echo-inkhud
both build, covering the menu changes no native env compiles.
0 commit comments