Describe the bug
loadClusterSettings calls JSON.parse() without any error handling. When
localStorage contains a corrupted entry (e.g. due to a browser extension,
storage quota truncation, or a manual edit), a SyntaxError is thrown and
propagates uncaught to all 10+ callers (NamespacesAutocomplete, GlobalSearch,
NodeShellTerminal, PodDebugTerminal, etc.), causing a blank/crashed settings panel.
Additionally, valid but non-object JSON (e.g. 123, [], "string") passes
through silently and is returned as a non-object value, breaking all downstream
property accesses.
This is a follow-up to the closed issue #6023 which was never code-fixed.
To Reproduce
- Open DevTools → Application → Local Storage
- Set
cluster_settings.<your-cluster-name> to {not valid json
- Navigate to any cluster settings page
- See
SyntaxError crash / blank panel
Environment
- Installation type: Any
- Headlamp Version: current main
Are you able to fix this issue?
Yes (I will propose a PR)
Describe the bug
loadClusterSettingscallsJSON.parse()without any error handling. WhenlocalStorage contains a corrupted entry (e.g. due to a browser extension,
storage quota truncation, or a manual edit), a
SyntaxErroris thrown andpropagates uncaught to all 10+ callers (NamespacesAutocomplete, GlobalSearch,
NodeShellTerminal, PodDebugTerminal, etc.), causing a blank/crashed settings panel.
Additionally, valid but non-object JSON (e.g.
123,[],"string") passesthrough silently and is returned as a non-object value, breaking all downstream
property accesses.
This is a follow-up to the closed issue #6023 which was never code-fixed.
To Reproduce
cluster_settings.<your-cluster-name>to{not valid jsonSyntaxErrorcrash / blank panelEnvironment
Are you able to fix this issue?
Yes (I will propose a PR)