fix(config): gate Traffic Management/StatusMessage support on firmware version#3457
Conversation
…e version
Device Configuration showed Traffic Management (and StatusMessage) as
"Unsupported by this device" on firmware that fully supports them
(e.g. v2.7.24). The supportedModules flags were derived from the presence
of the decoded ModuleConfig sub-message (!!moduleConfig.trafficManagement),
but Proto3 omits a sub-message whose every field is default. A device that
has never configured the module (the common case) therefore sends no
sub-message, so it was reported as unsupported regardless of firmware.
Gate on the firmware version instead — which is exactly what the UI message
already promises ("requires firmware v2.7.22 or newer"). Adds a private
firmwareVersionAtLeast() helper plus supportsStatusMessage() (>= 2.7.19)
and supportsTrafficManagement() (>= 2.7.22), mirroring the existing
supportsFavorites() pattern, and uses them in getCurrentConfig().
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review Complete ✅This is an excellent fix that addresses a fundamental Proto3 serialization issue affecting module support detection. Here's my comprehensive review: ✅ Code Quality & Best PracticesExcellent implementation with strong adherence to best practices:
Minor suggestion: Consider extracting the firmware version thresholds as constants: private static readonly STATUS_MESSAGE_MIN_VERSION = { major: 2, minor: 7, patch: 19 };
private static readonly TRAFFIC_MANAGEMENT_MIN_VERSION = { major: 2, minor: 7, patch: 22 };✅ Bug AnalysisNo bugs identified. The implementation correctly handles:
✅ Performance ConsiderationsExcellent performance characteristics:
✅ Security AssessmentNo security concerns identified:
✅ Test Coverage - OutstandingExemplary test suite with comprehensive coverage:
The test file structure is excellent with clear mocking strategy and good test organization. 🎯 Problem Solution QualityThis fix addresses the exact root cause described in the PR:
📋 Minor Recommendations
🏆 Overall AssessmentThis is high-quality production code that:
The implementation demonstrates deep understanding of both the Proto3 serialization behavior and the codebase patterns. The comprehensive test suite particularly stands out as exemplary. Recommendation: Approve and merge - this is ready for production. |
…mote-only) (#3460) 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>
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>
…save (#3464) (#3465) #3457 made the Status Message and Traffic Management module configs editable (gated on firmware version), and the protobuf encoder's configFieldMap already supported both. But the generic save route POST /api/config/module/:moduleType validates against a separate hardcoded allow-list that was never updated, so saving either one returned HTTP 400 "Invalid module type: statusmessage" / "...: trafficmanagement" (#3464). Extract the allow-list into an import-safe shared constant (VALID_MODULE_CONFIG_TYPES + isValidModuleConfigType) that includes both new types, and use it in the route. Add a unit test asserting the two types are accepted and that telemetry/neighborinfo (dedicated routes) stay excluded — so this allow-list / encoder drift can't silently recur. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
On firmware that fully supports Traffic Management (e.g. v2.7.24), the Device Configuration tab still showed it as "Unsupported by this device — requires Meshtastic firmware v2.7.22 or newer." The
supportedModulesflags were derived from the presence of the decodedModuleConfigsub-message, but Proto3 omits a sub-message whose every field is default. A device that has never configured the module (the common case) sends no sub-message, so it was reported as unsupported regardless of firmware. This switches the gate to a firmware-version check — exactly what the UI message already promises.Changes
firmwareVersionAtLeast(major, minor, patch)helper (reuses existingparseFirmwareVersion).supportsStatusMessage()(≥ 2.7.19) andsupportsTrafficManagement()(≥ 2.7.22), mirroring the existingsupportsFavorites()pattern.getCurrentConfig().supportedModulesnow gates on these helpers instead of!!moduleConfig.statusmessage/!!moduleConfig.trafficManagement.meshtasticManager.moduleSupport.test.tsregression suite.Issues Resolved
None (reported directly: Traffic Management shown unsupported on firmware v2.7.24).
Documentation Updates
No documentation changes needed — this is backend support-detection logic; no feature docs describe the gating, and CHANGELOG is generated at release time.
Testing
tsc --noEmit)actualModuleConfigreports both modules supported; old firmware reports them unsupported even with a stale config object present🤖 Generated with Claude Code