fix: prevent session reset when updating host properties #490

Merged
ZacharyZcR merged 1 commits from fix/host-update-session-reset into dev-1.10.1 2026-01-12 07:30:02 +00:00
ZacharyZcR commented 2026-01-11 11:55:14 +00:00 (Migrated from github.com)

Summary

  • Use hostConfig.id instead of entire hostConfig object in useEffect dependency array
  • Prevents unnecessary terminal reconnections when host properties are updated

Root cause: When any host property is updated, updateHostConfig() creates a new object reference. The Terminal component's useEffect depended on the entire hostConfig object, so any reference change triggered reconnection logic.

Fix: Only depend on hostConfig.id since we only need to reconnect when switching to a different host, not when properties of the same host change.

Before: Edit any host → all open terminals disconnect and reconnect
After: Edit any host → terminals stay connected

Related to #401

## Summary - Use `hostConfig.id` instead of entire `hostConfig` object in useEffect dependency array - Prevents unnecessary terminal reconnections when host properties are updated **Root cause**: When any host property is updated, `updateHostConfig()` creates a new object reference. The Terminal component's useEffect depended on the entire `hostConfig` object, so any reference change triggered reconnection logic. **Fix**: Only depend on `hostConfig.id` since we only need to reconnect when switching to a different host, not when properties of the same host change. **Before**: Edit any host → all open terminals disconnect and reconnect **After**: Edit any host → terminals stay connected Related to #401
Sign in to join this conversation.