fix(messages): exclude traceroute rows from UI message window (#2741)#2745
Conversation
Traceroute responses were saved to the messages table with portnum=70 and counted toward the 100-row cap that UI endpoints fetch, but the client always filters them out of chat lists (MessagesTab displays portnum=1). A successful traceroute therefore displaced a real DM from the capped window, making it vanish on reload. Adds an optional excludePortnums arg to MessagesRepository.getMessages and passes [TRACEROUTE_APP] from every UI-facing caller (poll, source messages, recent messages, unified legacy fetch). NULL portnum rows are retained to preserve legacy data. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job Code Review Complete ✅I've thoroughly reviewed this pull request implementing the traceroute message exclusion fix. Here's my comprehensive assessment: 🎯 SummaryThis is an excellent solution to issue #2741. The fix correctly prevents traceroute responses from displacing DMs in the UI by adding an optional ✅ Strengths1. Surgical and Targeted Fix
2. Robust Implementation
3. Comprehensive Test Coverage
🔧 Code Quality AssessmentRepository Guidelines Compliance: ✅
Implementation Quality: ✅
🔒 Security & PerformanceSecurity: ✅ No concerns
Performance: ✅ Optimized approach
🎯 Changed Files ReviewCore Implementation ( const whereClause = (excludePortnums && excludePortnums.length > 0)
? and(
this.withSourceScope(messages, sourceId),
or(isNull(messages.portnum), notInArray(messages.portnum, excludePortnums)),
)
: this.withSourceScope(messages, sourceId);
Caller Updates: All properly implemented
🧪 Test Coverage AnalysisThe test suite is exceptionally thorough:
Each test has clear, descriptive names and excellent documentation. 📋 Minor ObservationsConsistency Note: The async version doesn't have a corresponding sync
🎯 VerdictExcellent implementation ⭐⭐⭐⭐⭐ This PR demonstrates:
Recommendation: Approve and merge. This is a well-crafted fix that solves the issue cleanly without introducing technical debt or breaking changes. |
…s arg The traceroute-exclusion fix added a 4th arg to getMessages calls in unifiedRoutes, breaking this strict-arg assertion. Update the expected call signature to include [70] (PortNum.TRACEROUTE_APP). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: Traceroute Message Exclusion FixReviewing PR #2745 that fixes issue #2741 where traceroute responses were displacing DMs in the UI message window. Todo List:
🎯 SummaryThis is an excellent solution to issue #2741. The fix correctly prevents traceroute responses from displacing DMs in the UI by adding an optional ✅ Strengths1. Surgical and Targeted Fix
2. Robust Implementation
3. Comprehensive Test Coverage
🔧 Code Quality AssessmentRepository Guidelines Compliance: ✅
Implementation Quality: ✅
🔒 Security & PerformanceSecurity: ✅ No concerns
Performance: ✅ Optimized approach
🎯 Changed Files ReviewCore Implementation ( const whereClause = (excludePortnums && excludePortnums.length > 0)
? and(
this.withSourceScope(messages, sourceId),
or(isNull(messages.portnum), notInArray(messages.portnum, excludePortnums)),
)
: this.withSourceScope(messages, sourceId);
Caller Updates: All properly implemented
🧪 Test Coverage AnalysisThe test suite is exceptionally thorough:
Each test has clear, descriptive names and excellent documentation. 📋 Minor ObservationsConsistency Note: The async version doesn't have a corresponding sync
🎯 VerdictExcellent implementation ⭐⭐⭐⭐⭐ This PR demonstrates:
Recommendation: Approve and merge. This is a well-crafted fix that solves the issue cleanly without introducing technical debt or breaking changes. |
System Test ResultsMeshMonitor System Test ResultsTest Run: 2026-04-20 14:22:58 EDT Test Summary
❌ Overall Result: FAILEDSome tests failed. Please review the failures above and fix before creating/updating PR. Failed Tests
|
System Test ResultsMeshMonitor System Test ResultsTest Run: 2026-04-20 14:41:18 EDT Test Summary
✅ Overall Result: PASSEDAll deployment configurations are working correctly! Test DetailsConfiguration Import:
Quick Start Test:
Security Test:
V1 API Test:
Reverse Proxy Test:
Reverse Proxy + OIDC Test:
Virtual Node CLI Test:
Backup & Restore Test:
Database Migration Test:
DB Backing Consistency Test:
|
Summary
messagestable (portnum=70), but the UI's DM view filters them out (portnum === 1). Every UI feed is capped at 100 rows, so each traceroute displaced one real DM out of the window. Repeating drained all DMs.excludePortnumsarg toMessagesRepository.getMessagesand pass[TRACEROUTE_APP]from every UI-facing caller (poll,/api/sources/:id/messages,getRecentMessages, unified legacy fetch). NULL-portnum rows are preserved for legacy data. Public v1 API, cache warming, and export paths are unchanged.Changed callers
src/server/server.ts—/api/pollmessage windowsrc/server/meshtasticManager.ts—getRecentMessages(feeds/api/messages)src/server/routes/sourceRoutes.ts—/api/sources/:id/messagessrc/server/routes/unifiedRoutes.ts— legacy no-channel unified fetchTest plan
messages.exclude-portnums.test.ts— 4 tests including the explicit [BUG] Successfull traceroute with node makes last message in chat with that node dissapeared #2741 scenario (traceroute arriving causes oldest DM to fall off the capped window unless filter is applied).🤖 Generated with Claude Code