refactor(node): Improve public key conflict handling#4486
Merged
Conversation
This commit refactors the logic for handling public key (PKC) updates for nodes in the database to be more robust and explicit. Key changes: - Sets the public key to a specific `ERROR_BYTE_STRING` upon detecting a genuine mismatch between two valid, non-empty keys. - Preserves the existing key during routine node updates (e.g., position packets) that don't contain a new key. - Allows a node to recover from the error state if it later provides a valid, matching key. - Explicitly clears the public key for licensed (HAM) users, as they do not use PKC. - Updates the UI in Node Details and related components to visually indicate the error state, preventing users from copying the invalid key. This new logic provides a clearer and more predictable state for node public keys, especially in cases of factory resets or hardware ID collisions. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4486 +/- ##
========================================
- Coverage 9.21% 9.21% -0.01%
========================================
Files 427 427
Lines 14342 14351 +9
Branches 2385 2389 +4
========================================
Hits 1322 1322
- Misses 12767 12776 +9
Partials 253 253 ☔ View full report in Codecov by Sentry. |
Contributor
could this possibly be |
Collaborator
Author
good eye #4555 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit refactors the logic for handling public key (PKC) updates for nodes in the database to be more robust and explicit.
Key changes:
ERROR_BYTE_STRINGupon detecting a genuine mismatch between two valid, non-empty keys.This new logic provides a clearer and more predictable state for node public keys, especially in cases of factory resets or hardware ID collisions.