Conversation
…SKs (#2939) Channel Database UI was mislabeling encryption types: pskLength of 0 or 1 was incorrectly shown as AES-256, and an empty PSK rendered as "..." preview as if a key existed. - ChannelDatabaseSection: handle pskLength 0 (None / no key shown), 1 (Shorthand AES-128), 16 (AES-128), 32 (AES-256), and an Unknown fallback for anything else. - channelDatabase route: when channel.psk is empty, return "(none)" for pskPreview instead of "...". Fixes #2939 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job Code Review: Channel Encryption Label FixI've completed my review of this PR that fixes channel encryption label display. Here's my comprehensive analysis:
✅ Overall Assessment: LGTM with Minor SuggestionsThis is a solid bug fix that correctly addresses the mislabeling issue. The changes are well-implemented and follow the codebase conventions. Code Quality & Logic ReviewFrontend Changes (ChannelDatabaseSection.tsx:171-181) ✅The new PSK length handling logic is excellent: // OLD: Binary logic that missed important cases
pskLength === 16 ? 'AES-128' : 'AES-256'
// NEW: Comprehensive handling of all documented cases
{channel.pskLength === 0
? 'PSK: (none) (None)'
: `PSK: ${channel.pskPreview} (${
channel.pskLength === 1
? 'Shorthand (AES-128)'
: channel.pskLength === 16
? 'AES-128'
: channel.pskLength === 32
? 'AES-256'
: 'Unknown'
})`}Strengths:
Backend Changes (channelDatabase.ts:30) ✅The PSK preview fix is appropriate: // OLD: Misleading preview for empty PSKs
pskPreview: includeFullPsk ? channel.psk : (channel.psk ? `${channel.psk.substring(0, 8)}...` : '(none)')
// NEW: Clear indication of no PSK
pskPreview: includeFullPsk ? channel.psk : (channel.psk ? `${channel.psk.substring(0, 8)}...` : '(none)')The change from Security Analysis ✅No security concerns identified:
Edge Cases & Error HandlingWell-Handled Cases:
Potential Edge Case to Consider:The frontend logic assumes // Potential improvement (not required for this fix):
const derivedLength = channel.psk ? atob(channel.psk).length : 0;
const displayLength = channel.pskLength ?? derivedLength;Test Coverage AssessmentExisting Coverage:
Missing Coverage for This Fix:The new UI display logic isn't covered by unit tests. Consider adding tests for: describe('PSK length display logic', () => {
it('should show "None" for zero-length PSK', () => {
// Test pskLength === 0 case
});
it('should show "Shorthand (AES-128)" for length 1', () => {
// Test pskLength === 1 case
});
it('should show "Unknown" for unexpected lengths', () => {
// Test edge case with unusual pskLength
});
});Performance Considerations ✅No performance impact:
Code Style & Consistency ✅Follows project conventions:
Suggestions for Improvement1. Consider Extracting Display Logic (Optional)The nested ternary could be extracted for better readability: const getPskDisplayLabel = (pskLength: number): string => {
switch (pskLength) {
case 0: return 'None';
case 1: return 'Shorthand (AES-128)';
case 16: return 'AES-128';
case 32: return 'AES-256';
default: return 'Unknown';
}
};
// Usage:
{channel.pskLength === 0
? 'PSK: (none) (None)'
: `PSK: ${channel.pskPreview} (${getPskDisplayLabel(channel.pskLength)})`
}2. Add JSDoc Documentation (Minor)Consider documenting the PSK length meanings: /**
* PSK length meanings:
* 0 = No encryption
* 1 = Shorthand (expands to 16-byte AES-128)
* 16 = AES-128
* 32 = AES-256
*/Final Verdict: ✅ APPROVEDThis PR successfully fixes the reported issue with minimal risk and good implementation quality. The changes are:
Recommendation: Merge after addressing any minor suggestions you find valuable. The core fix is solid and ready for production. |
System Test ResultsMeshMonitor System Test ResultsTest Run: 2026-05-09 13:38:19 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:
|
…2939) Covers the PR #2944 fix: - ChannelDatabaseSection.encryptionLabel.test.tsx renders the real component with mocked apiService and verifies the PSK label for pskLength values 0, 1, 16, 32, and an unknown value (7). Reverting the JSX branch causes 3/5 cases to fail. - channelDatabaseTransform.test.ts mirrors the pskPreview expression from src/server/routes/v1/channelDatabase.ts to lock in the masked branch returning "(none)" for empty/null/undefined PSKs and the truncated preview otherwise. The helper is private and the masked branch is gated behind admin-only routes, so this follows the logic-spec convention from tests/unit/channelDatabasePermissions.test.ts. No production code changes.
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
System Test ResultsMeshMonitor System Test ResultsTest Run: 2026-05-09 15:14:56 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:
|
* chore(release): bump version to 4.3.0 Headline feature: Waypoints — per-source storage, map rendering, and in-place authoring UI for Meshtastic WAYPOINT_APP pins. Includes since 4.2.3: - #2936/#2938 feat(waypoints): basic waypoint support - #2942 feat(waypoints): authoring UI for create/edit/delete - #2937 fix(auth): bootstrap first OIDC user as admin - #2935 fix(traceroute): stop cascading IP-style across radio segments - #2945 feat: Tile Selection / Legend visibility toggles in Map Features - #2944 fix: correct channel encryption label for unencrypted/shorthand PSKs - #2946 fix(mobile): mobile browser interface fixes - #2948 fix: map tileset selection not applying on dashboard - docs: new Waypoints feature page; 4.3 Highlights nav entry Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * docs: list Waypoints under regular Features instead of 4.3 Highlights Per Randall: Waypoints should be documented like any other feature, not called out in the nav as a "🆕 4.3 Highlights" section. - Drop the "🆕 4.3 Highlights" entry from the top nav and the /features/ sidebar; restore "🆕" on 4.2 Highlights as the most-recent callout - Add Waypoints to the regular Features sidebar list (next to Embed Maps) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * docs: drop version-Highlights nav sections, fold entries into Features Removes the "🆕 4.2 / 4.1 / 4.0 Highlights" callouts from both the top nav and the /features/ sidebar. Their pages — Analysis & Reports, Map Analysis, Multi-Source, Per-Source Permissions, Global Settings, Store & Forward, Geofence Triggers — now live in the regular Features list, slotted near topically-related entries (Multi-Source / permissions near Settings; Geofence Triggers next to Automation; Map Analysis next to Embed Maps; Analysis & Reports next to Analytics; etc.). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Fixes #2939. The Channel Database UI was mislabeling encryption types based on
pskLength, and showed a misleading...preview for empty PSKs.Changes
src/components/configuration/ChannelDatabaseSection.tsx— replaced thepskLength === 16 ? 'AES-128' : 'AES-256'ternary with logic covering all four documented cases plus anUnknownfallback. WhenpskLength === 0, the line now rendersPSK: (none) (None)instead of pretending a key exists.0→None1→Shorthand (AES-128)16→AES-12832→AES-256Unknownsrc/server/routes/v1/channelDatabase.ts— whenchannel.pskis empty,pskPreviewis now"(none)"instead of"...". TheincludeFullPsk(admin) branch is unchanged.Test plan
npx tsc --noEmit— no errorsnpx vitest run tests/unit/channelDatabasePermissions.test.ts— 26/26 passnpm run lintfor the two changed files surfaces only pre-existing warnings (no new issues)