feat(meshcore): compact {ROUTE} auto-ack variable by dropping arrow spaces (#3776)#3779
Conversation
…paces (#3776) MeshCore channel messages are length-limited (~120 chars with a scope) and shorter messages transmit more reliably and cost less airtime. The {ROUTE} auto-acknowledge / auto-reply template variable previously expanded the hop chain with spaces around each arrow ("43ad → b8bf → 6abc → a5f2"). This drops the surrounding spaces so it renders as "43ad→b8bf→6abc→a5f2", saving 2 bytes per hop while staying readable. Adds meshcoreManager.autoAckRoute.test.ts covering the bare-arrow join, token trimming, single-hop, "direct" (0 hops), and "—" (unknown) fallbacks. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VBLhGGNh35oMwTL53va1Y5
|
Claude finished @Yeraze's task —— View job PR Review: feat(meshcore): compact {ROUTE} auto-ack variable (#3776)
SummaryThis is a clean, well-scoped change. The core modification (dropping spaces around Code Quality
The implementation is clean. The updated comment accurately documents the rationale and references the issue number, which is good practice. One minor observation: the hardcoded version string on line 5241 ( Test Coverage
The test file is well-structured and covers the key cases:
One gap worth noting: There is no test for the case where if (route && route.length > 0) {
routeStr = route
.split(',')
.map(h => h.trim())
.filter(Boolean)
.join('→');If Security & PerformanceNo concerns. This is a display/formatting change with no I/O, no user-facing attack surface beyond a 2-byte airtime savings, and no performance implications. OverallApproved direction — the change is correct, minimal, and well-tested for the happy path and the main edge cases. The empty-token-after-filter edge case is worth a follow-up test but is not a blocker for this PR. |
Summary
Closes #3776.
MeshCore channel messages are length-limited (~120 chars when a scope is present), and shorter messages transmit more reliably while costing less airtime. The
{ROUTE}template variable used in Auto Acknowledge / auto-reply messages expanded the relay-hash hop chain with spaces around every arrow. This removes the surrounding spaces so the route stays readable but more compact, saving 2 bytes per hop.Before / After
Change
src/server/meshcoreManager.ts— inreplaceAutoAckTokens, the hop join changed from.join(' → ')to.join('→')(same→glyph, no surrounding spaces). Comment updated to document the airtime rationale.direct(0 hops) and—(unknown) fallbacks are unchanged.Tests
src/server/meshcoreManager.autoAckRoute.test.tsasserts:→ever returning)directfallback when route is empty and hops === 0—fallback when route and hop count are unknownmeshcoreManager.scope.test.ts,meshcoreNativeBackend.otaPacket.test.ts, new suite — 56 tests, 0 failures.Display/formatting change only; no
system-testlabel.🤖 Generated with Claude Code