fix(traceroute): skip processing our own outgoing traceroute responses (#1140)#1144
Conversation
#1140) When another node traceroutes us, our firmware sends a response that we capture. This response only contains the forward path (route) but not a meaningful return path (routeBack), causing incorrect "direct line" route segments to be displayed on the map. Now we skip processing traceroute responses where fromNum equals our local node number, since those are responses we sent, not results we requested. Closes #1140 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job Code Review Complete ✅Todo List
📋 Review SummaryThis is a well-targeted fix for issue #1140 that addresses incorrect "direct line" route segments on the map when other nodes traceroute the local MeshMonitor node. ✅ Code Quality & Best PracticesExcellent implementation with several strengths:
✅ Logic AnalysisThe fix correctly identifies the root cause:
Location: 🔍 Potential Issues1. Null Safety Consideration if (this.localNodeInfo && fromNum === this.localNodeInfo.nodeNum) {The code correctly checks 2. Edge Case: Startup Race Condition ⚡ PerformanceMinimal impact:
🔒 SecurityNo security concerns:
🧪 Test CoverageRecommendation: Add a unit test to verify this behavior: // Suggested test case
it('should skip traceroute responses from local node', () => {
// Mock localNodeInfo with known nodeNum
// Create meshPacket with from === localNodeInfo.nodeNum
// Verify processTracerouteMessage returns early
// Verify debug log is called
});The fix would benefit from a test in 📊 Overall AssessmentScore: 9/10 - Excellent implementation Strengths:
Minor improvement:
✅ RecommendationApprove this PR - The implementation is solid and addresses the issue correctly. Consider adding the suggested unit test as a follow-up task. |
|
this bug is still present in last version (v2.21.12) |
|
Can you provide additional data? (Logs, screenshots) |
|
here is traceroute from r9oot to me : here is log grep: as i can see log says that it was response from 9e9fc688 (which is r9oot indeed) but it is not. |
Yeraze#1140) (Yeraze#1144) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Problem
When another node (A) sends a traceroute request to us (B):
route(path TO us), butrouteBackis emptySolution
Check if
fromNumequals our local node number inprocessTracerouteMessage(). If so, skip processing since it's our own response to someone else's request, not a traceroute result we requested.Test plan
Skipping traceroute response from local nodeCloses #1140
🤖 Generated with Claude Code