fix(config): store local-node module config responses (handler was remote-only)#3460
Conversation
…mote-only) The getModuleConfigResponse handler in processAdminMessage was entirely wrapped in `if (isRemoteNode)`, so explicit local module-config refreshes (requestModuleConfig / requestAllModuleConfigs / refreshModuleConfigs) were logged and then discarded — only the initial wantConfig download stream ever populated the local node's actualModuleConfig. The Proto3-empty fallback that records an all-default module under its key was also remote-only. Add a local-node branch that merges the response into actualModuleConfig and, for an empty (all-default, Proto3-omitted) response, records the module under the pending request's key without clobbering an already-populated config. requestModuleConfig now tracks that pending key (via LOCAL_MODULE_CONFIG_TYPE_KEYS, keyed by the local node number) so the fallback can resolve it. Discovered while fixing #3457 (Traffic Management shown unsupported on 2.7.24). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job Reviewing PR #3460I've thoroughly reviewed this pull request that fixes the local module config response handling bug. Here's my comprehensive analysis: Todo List:
🟢 Overall Assessment: APPROVEDThis is a well-implemented bug fix with excellent test coverage. The changes are focused, safe, and address a real functional issue. ✅ Code Quality & Best PracticesExcellent implementation following established patterns:
Code organization:
✅ Bug Analysis & CorrectnessProblem correctly identified and fixed:
Implementation correctness:
✅ Performance ConsiderationsNo performance concerns:
✅ Security AnalysisNo security issues identified:
✅ Test CoverageComprehensive test suite (
Test quality:
🟡 Minor Suggestions
✅ Documentation & ContextWell-documented change:
🎯 Issues ResolvedThis fix resolves the core issue where:
Recommendation: MERGE ✅This is a solid, well-tested bug fix that:
|
Bump version to 4.10.3 across package.json, package-lock.json, helm/meshmonitor/Chart.yaml, desktop/package.json, and desktop/src-tauri/tauri.conf.json. Finalize the CHANGELOG: promote [Unreleased] to [4.10.3] and add the entries merged after the section was last written — MQTT NodeInfo clobber fix (#3456), Traffic Management/StatusMessage firmware-version gate (#3457), local-node module config storage (#3460), phantom channel swap fix (#3453), and the TX power help-text clarification (#3459). Add a release blog post highlighting the Traffic Management detection fix and the bug-fix round. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
The
getModuleConfigResponsehandler inprocessAdminMessage(src/server/meshtasticManager.ts) was entirely wrapped inif (isRemoteNode). For the local node, the response was logged and then discarded — it never merged intothis.actualModuleConfig. Only the initialwantConfigdownload stream ever populated the local node's module config, so explicit refreshes (requestModuleConfig/requestAllModuleConfigs/refreshModuleConfigs) of the local node were effectively no-ops. The Proto3-empty fallback that records an all-default module under its key was also remote-only.This is the contributing bug found while fixing #3457 (Traffic Management shown unsupported on firmware v2.7.24). That PR resolved the support-detection symptom via firmware-version gating; this PR makes explicit local module-config refreshes actually persist.
Changes
getModuleConfigResponsehandler that merges the response intoactualModuleConfig(preserving existing keys).requestModuleConfig()now tracks the pending key (keyed by the local node number) so the empty-response fallback can resolve it.LOCAL_MODULE_CONFIG_TYPE_KEYSmap (ModuleConfigType enum → decoded ModuleConfig oneof key).Issues Resolved
Relates to #3457 (contributing bug; not user-visible for support detection after #3457).
Documentation Updates
No documentation changes needed — internal config-sync logic.
Testing
tsc --noEmit)meshtasticManager.localModuleConfig.test.ts(6 cases): non-empty merge preserves existing keys; empty response records pending key;from: 0local-origin case; no-clobber of a populated config; remote responses don't leak into local config;requestModuleConfigpending-key trackingactualModuleConfig🤖 Generated with Claude Code