fix: traceroute duplication caused by bypassing deduplication logic#2387
fix: traceroute duplication caused by bypassing deduplication logic#2387
Conversation
meshtasticManager.ts called databaseService.traceroutes.insertTraceroute() (the repository directly), bypassing the deduplication logic in databaseService.insertTraceroute() which checks for pending traceroute requests and updates them instead of inserting duplicates. This caused every traceroute response to create a new record even when a pending request record already existed, resulting in duplicate entries in traceroute history. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review AnalysisReviewing this pull request for code quality, potential issues, performance, security, and test coverage. Todo List:
Code Review Feedback✅ Excellent Fix - Root Cause Correctly IdentifiedThis PR addresses a clear architectural issue where the code was bypassing the intended deduplication logic. The fix is minimal, targeted, and correct. Original Problem:
Fix Applied:
Code Quality & Best Practices ⭐Strengths:
Note on async/await:
Deduplication Logic Analysis 🔍The deduplication works by:
This logic is robust and handles the bidirectional nature of traceroutes correctly. Potential Issues
|
Summary
meshtasticManager.tscalleddatabaseService.traceroutes.insertTraceroute()(the repository directly), bypassing the deduplication logic indatabaseService.insertTraceroute()Fix
One-line change: redirect the call from the repository's
insertTraceroute()to the DatabaseService'sinsertTraceroute()which contains the deduplication logic.Test Plan
npx vitest run— 3070 tests pass, 0 failuresnpm run build— no TypeScript errors./tests/system-tests.sh— 10/10 pass🤖 Generated with Claude Code