Repository navigation
fix(cli): persist mqtt.config, mqtt.filter.interval and slot extras - #26
Merged
Elektr0Vodka merged 1 commit intoOct 19, 2026
Merged
Conversation
These three DMC setters change MQTTPrefs but saved with plain savePrefs(). Since 75f3e44 that only writes /prefs.json (save_mqtt defaults to false), so the change replied OK, applied until reboot, and was then lost. The failure path also skipped the observer rollback. They now use persistObserverPrefs(reply), like every other observer setter: written to /mqtt.json, rolled back with an error if the write fails. The setters were written while savePrefs() still saved both files; the catch-up that brought in 75f3e44 merged without a conflict. Verified: heltec_v4_repeater_observer_mqtt builds. No native test covers CommonCLI_Observer.cpp.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
set mqtt.config,set mqtt.filter.intervalandset mqttN.extrasreplied OK and took effect, but were lost on the next reboot.These three DMC setters change
MQTTPrefsbut saved with plainsavePrefs(). Since agessaman's 75f3e44,savePrefs()only writes/prefs.json(save_mqttdefaults tofalse), so/mqtt.jsonwas never written. The failure path also skipped the observer rollback.The setters were written (Aug 21–29) while
savePrefs()still saved both files. The catch-up that brought in 75f3e44 merged without a conflict, so nothing flagged it.Fix
All three now use
persistObserverPrefs(reply), like every other observer setter. The value is written to/mqtt.json, and if the write fails the change is rolled back and an error is returned.ota branchkeepssavePrefs(), because it writes NodePrefs.Test
pio run -e heltec_v4_repeater_observer_mqttbuilds.CommonCLI_Observer.cpp, so this is not unit-tested. To check on a device:set mqtt.config on, reboot, thenget mqtt.configshould still say on.Notes
Found during the 2026-10-19 architecture review (side finding 1).
🤖 Generated with Claude Code