fix: PKI_UNKNOWN_PUBKEY errors now correctly flag key mismatch#2382
fix: PKI_UNKNOWN_PUBKEY errors now correctly flag key mismatch#2382
Conversation
PKI_UNKNOWN_PUBKEY and PKI_SEND_FAIL_PUBLIC_KEY routing errors were suppressed when the target node wasn't in the radio's device database. The guard assumed this was only expected after factory reset/purge, but it also suppressed legitimate key mismatch detection for nodes the radio simply doesn't know about. Removed the isNodeInDeviceDb() guard from both routing error paths (request packets and message-tracked packets). The key mismatch flag will now clear naturally via the resolution logic in PR #2365 when keys are re-synced. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: PKI_UNKNOWN_PUBKEY Error Detection FixReviewing this pull request for code quality, potential bugs, performance, security concerns, and test coverage. Review Checklist:
Code Review Summary✅ Positive Aspects
|
- 9 new tests for isPkiError, RoutingError constants, getPortNumName - Document PKI error detection rules in ARCHITECTURE_LESSONS.md - Anti-pattern: never gate PKI detection on isNodeInDeviceDb() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: PKI_UNKNOWN_PUBKEY Error Detection Fix
|

Summary
PKI_UNKNOWN_PUBKEYandPKI_SEND_FAIL_PUBLIC_KEYrouting errors were not triggering key mismatch detection when the target node wasn't in the radio's device database.Root Cause
Both routing error paths (request packets at line ~5349, message-tracked packets at line ~5406) had a guard:
This assumed the error was only expected after factory reset/purge, but it also suppressed detection for legitimate cases where the radio doesn't know the node's public key.
Fix
Removed the
isNodeInDeviceDb()suppression guard. All PKI errors now flagkeyMismatchDetected = trueregardless of device DB state. The flag clears naturally when keys are re-synced (via PR #2365's resolution logic).Files Changed
src/server/meshtasticManager.tsisNodeInDeviceDbguard from both PKI error pathsTest plan
🤖 Generated with Claude Code