Skip to content

fix: LocalStorage Compatibility#14

Merged
pozgo merged 1 commit into
mainfrom
dev
Jan 28, 2026
Merged

fix: LocalStorage Compatibility#14
pozgo merged 1 commit into
mainfrom
dev

Conversation

@pozgo

@pozgo pozgo commented Jan 28, 2026

Copy link
Copy Markdown
Owner

LocalStorage Compatibility Fix

Fixed

  • Terminal white page crash on upgrade: Fixed TypeError: b.indexOf is not a function that occurred when users with existing terminal tab data upgraded to newer versions. The issue was caused by legacy localStorage data storing sshKeyId as a numeric value, while newer code expected a string format ("local:123" or "vault:keyname").

Changed

  • TerminalPane.jsx: Added type coercion to ensure sshKeyId is converted to string before calling string methods
  • TerminalContext.jsx: Added comprehensive data validation when restoring tabs from localStorage:
    • Filters out invalid/corrupted tab entries (must be objects with valid id)
    • Converts numeric sshKeyId to string (handles null and undefined)
    • Ensures shell has a valid string value with fallback to 'bash'
    • Ensures title has a valid string value with fallback to 'Terminal'
    • Ensures id is always a string
    • Falls back to default tab if no valid tabs can be restored

Technical Details

  • Root cause: Older versions stored SSH key IDs as numbers (e.g., 5), but the composite ID format introduced for Vault integration expects strings (e.g., "local:5")
  • Impact: Users upgrading from versions prior to Vault integration would see a white page when navigating to the Terminal
  • Resolution: Defensive coding with String() coercion and comprehensive data validation handles both old and new data formats, as well as corrupted localStorage data

Security Audit Notes

  • Input validation added to filter malformed localStorage entries
  • All string conversions use safe String() coercion
  • Null-safe checks with != null to handle both null and undefined
  • Graceful fallback to defaults prevents crash on corrupted data

Documentation

  • Added Vault Setup Guide: Comprehensive documentation (docs/VAULT_SETUP.md) for HashiCorp Vault integration including:
    • Prerequisites and Vault server setup (dev & production)
    • KV v2 secrets engine configuration
    • Vault policy examples (full access & read-only)
    • Token and AppRole authentication setup
    • Web CLI configuration via UI and API
    • Examples for storing SSH keys, servers, environment variables, and scripts
    • Group/category organization support (v0.3.0+)
    • Troubleshooting guide for common issues
    • Security best practices

@pozgo pozgo self-assigned this Jan 28, 2026
@pozgo
pozgo merged commit f95074b into main Jan 28, 2026
16 checks passed
@pozgo
pozgo deleted the dev branch February 1, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant