fix: coerce admin keys to strings in ConfigurationTab (#2353)#2354
fix: coerce admin keys to strings in ConfigurationTab (#2353)#2354
Conversation
The /api/config/current endpoint returns raw protobuf admin keys as
serialized Buffer objects (e.g., {type:'Buffer', data:[...]}) rather
than base64 strings. SecurityConfigSection calls .trim() on these
during render, causing "ne.trim is not a function" crash.
Convert admin keys to base64 strings when loading from the raw config
endpoint, matching the conversion already done by the formatted
/api/device/config/security endpoint.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
1 similar comment
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
Claude finished @Yeraze's task —— View job PR Review Complete ✅I've thoroughly analyzed the changes in this PR that fixes the "ne.trim is not a function" crash. Here's my comprehensive review: Review Checklist:
Overall Assessment: APPROVED ✅This is a solid, well-targeted bug fix that addresses a real production issue without introducing new risks. Code Quality & Best Practices ✅Strengths:
Bug Analysis ✅Root cause correctly identified:
Edge cases handled:
Performance Considerations ✅
Security Review ✅
Test Coverage Assessment
|
Summary
Fixes #2353 — "ne.trim is not a function" crash on Configuration page.
/api/config/currentendpoint returns raw protobuf admin keys as serialized Buffer objects ({type:'Buffer', data:[...]}) rather than base64 strings.SecurityConfigSectioncalls.trim()on these values during render, which crashes because they're objects, not strings.ConfigurationTab.tsx, matching the conversion already done by the formatted/api/device/config/securityendpoint.Test plan
🤖 Generated with Claude Code