feat(meshcore): auto-acknowledge automation with channels, DM, and macros#3245
Conversation
…cros
Recreates the Meshtastic Auto-Acknowledge feature in the MeshCore
Automations tab: per-channel allowlist plus a separate DM checkbox,
"Always respond via DM" override, regex trigger with live test panel,
per-sender cooldown, and a templated reply with token macros
({NODE_ID}, {NODE_NAME}, {LONG_NAME}, {SHORT_NAME}, {DATE}, {TIME},
{SNR}, {VERSION}) plus a sample preview.
Backend wires checkAutoAcknowledge into handleBridgeEvent for both
contact_message and channel_message paths; routes live under
/api/sources/:id/meshcore/automation/autoack and persist via the
existing per-source settings store.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: Auto-Acknowledge AutomationComprehensive review of this 824-line auto-acknowledge implementation focusing on code quality, security, performance, and best practices. Todo List:
🟢 StrengthsExcellent Architecture & Integration:
Outstanding UX Implementation:
Solid Code Quality:
🟡 Areas for ImprovementSecurity Concerns:
Code Quality Issues:
Performance Considerations:
Missing Test Coverage:
🔴 Critical Issues
🎯 Recommended ActionsBefore Merge:
Nice to Have:
📊 Overall AssessmentThis is a well-architected feature that follows project conventions excellently. The code quality is good and the UX is thoughtful. However, the lack of test coverage is a critical blocker per repository standards. With proper testing and the security/performance fixes above, this would be a solid addition to MeshMonitor. Recommendation: Request test coverage before merge, address critical security/performance issues. |
The pathfinding view filled the viewport and clipped the new Auto-Acknowledge section off the bottom with no way to scroll. Give the container its own overflowY so all sections are reachable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: Auto-Acknowledge AutomationComprehensive review of this 824-line auto-acknowledge implementation focusing on code quality, security, performance, and best practices. Todo List:
🟢 StrengthsExcellent Architecture & Integration:
Outstanding UX Implementation:
Solid Code Quality:
🟡 Areas for ImprovementSecurity Concerns:
Code Quality Issues:
Performance Considerations:
Missing Test Coverage:
🔴 Critical Issues
🎯 Recommended ActionsBefore Merge:
Nice to Have:
📊 Overall AssessmentThis is a well-architected feature that follows project conventions excellently. The code quality is good and the UX is thoughtful. However, there are critical blockers that must be addressed:
Recommendation: Address critical security and testing issues before merge. The architecture and UX implementation are solid, but the security and reliability concerns need resolution. |
Forward the packed `pathLen` byte from ContactMsgRecv/ChannelMsgRecv
in the bridge events, decode the bottom 6 bits to a hop count
(0xFF → 0 = direct), and pull the sender contact's cached `outPath`
hash chain for DMs as the {ROUTE} expansion. Channel messages have
no sender pubkey on the wire, so {ROUTE} falls back to "—".
Supports {HOPS}, {NUMBER_HOPS} (alias for Meshtastic parity), and
{ROUTE} (arrow-separated hash chain, e.g. "a3 → 7f → 02").
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: Auto-Acknowledge Automation
|
ContactMsgRecv / ChannelMsgRecv only carry the packed pathLen byte
(hop count), not the relay-hash chain. LogRxData (0x88) is emitted
for every received OTA packet and exposes the raw bytes, which we
parse with meshcore.js's Packet.fromBytes to recover the actual path
hashes.
Wire the LogRxData listener in the native backend, buffer the path
for TXT_MSG packets only (single-slot, consumed by the next
contact/channel recv event since the firmware emits them in
order), and forward `path_hops` through the bridge event. The
manager prefers per-packet hops over the contact's cached outPath
fallback so {ROUTE} reflects the actual route this packet took.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: Auto-Acknowledge AutomationComprehensive review of this 880-line auto-acknowledge implementation focusing on code quality, security, performance, and best practices. Todo List:
🟢 StrengthsExcellent Architecture & Integration:
Outstanding UX Implementation:
Solid Code Quality:
🟡 Areas for ImprovementSecurity Concerns:
Code Quality Issues:
Performance Considerations:
Missing Test Coverage:
🔴 Critical Issues
🎯 Recommended ActionsBefore Merge:
Nice to Have:
📊 Overall AssessmentThis is a well-architected feature that follows project conventions excellently. The code quality is good and the UX is thoughtful. However, there are critical blockers that must be addressed:
Recommendation: Address critical security and testing issues before merge. The architecture and UX implementation are solid, but the security and reliability concerns need resolution. |
…injection) CodeQL flagged the bare `new RegExp(user_input, 'i')` compile-test at the route layer because the same input is later executed against every incoming message. The manager already shape-checks for ReDoS patterns at execution time, but the store-side gate didn't. Extract the validator into src/server/utils/autoAckRegex.ts and call it from both the route handler (store-time) and the manager (execution-time), so unsafe patterns are rejected before they ever reach the database. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: Auto-Acknowledge AutomationComprehensive review of this 880-line auto-acknowledge implementation focusing on code quality, security, performance, and best practices. Todo List:
🟢 StrengthsExcellent Architecture & Integration:
Outstanding UX Implementation:
Solid Code Quality:
Good Security Foundation:
🟡 Areas for ImprovementCode Quality Issues:
Performance Considerations:
Missing Test Coverage:
🎯 Recommended ActionsBefore Merge:
Nice to Have:
📊 Overall AssessmentThis is a well-architected feature that follows project conventions excellently. The code quality is good and the UX is thoughtful. The CodeQL security issue has been resolved with proper regex validation. Key Strengths:
Critical Blocker:
Recommendation: Add comprehensive test coverage following the excellent existing patterns in the codebase. The core implementation is solid and ready for production once properly tested. |
…injection)
CodeQL still flagged compileAutoAckRegex even with the length cap and
shape check because the static analyzer doesn't recognise structural
heuristics as taint sanitizers. Add a charset allowlist test as the
first gate so only patterns built from a fixed set of ASCII characters
(letters, digits, whitespace, and the regex meta-chars we actually
want to support) reach `new RegExp`. The allowlist test acts as a
recognised data-flow barrier for the js/regex-injection query while
also tightening the real attack surface by rejecting Unicode property
escapes (\\p{…}) and code-point escapes (\\u{…}).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: Auto-Acknowledge AutomationComprehensive review of this 880-line auto-acknowledge implementation focusing on code quality, security, performance, and best practices. Todo List:
🟢 StrengthsExcellent Architecture & Integration:
Outstanding UX Implementation:
Solid Code Quality:
Good Security Foundation:
🟡 Areas for ImprovementCode Quality Issues:
Performance Considerations:
Missing Test Coverage:
🎯 Recommended ActionsBefore Merge:
Nice to Have:
📊 Overall AssessmentThis is a well-architected feature that follows project conventions excellently. The code quality is good and the UX is thoughtful. The CodeQL security issue has been resolved with proper regex validation. Key Strengths:
Critical Blocker:
Recommendation: Add comprehensive test coverage following the excellent existing patterns in the codebase. The core implementation is solid and ready for production once properly tested. |
Patch release combining the MeshCore automation suite (auto-announce, auto-responder, timer triggers — #3249), auto-acknowledge automation (#3245), the handleConnected transport-swap race fix that was producing deterministic 3×/min reconnect loops on TCP Meshtastic sources (#3248 / #3247), MeshCore neighbor publicKey input validation (#3240), CodeQL security remediations covering polynomial-ReDoS, log-injection and regex-DoS (#3246), and a translations update (#3208). Updated CHANGELOG.md (converted [Unreleased] MeshCore-automation entry into a full [4.8.1] release section covering all six commits since 4.8.0), CLAUDE.md version header, and version across all 5 version files (package.json, package-lock.json, helm/meshmonitor/Chart.yaml, desktop/src-tauri/tauri.conf.json, desktop/package.json). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Summary
checkAutoAcknowledgehandler intomeshcoreManager.handleBridgeEventfor bothcontact_message(DM) andchannel_messagepaths, with regex validation, ReDoS protection, and contact-prefix resolution for DM addressing.meshcoreAutoAck*keys; CRUD lives atGET/POST /api/sources/:id/meshcore/automation/autoack(mirrors the auto-pathfinding route shape).Supported macros
{NODE_ID},{NODE_NAME},{LONG_NAME},{SHORT_NAME},{DATE},{TIME},{SNR},{VERSION}Test plan
^ping, enable a single channel, save — confirm the SaveBar fires and the values reload on refresh.pingon the enabled channel from another node → reply is published on the same channel.pingon a non-allowlisted channel → confirm no reply.() blocks save with an error toast.🤖 Generated with Claude Code