Repository navigation
fix(ssh): a user's Disconnect sticks until they connect the host again #23487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 14 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
597a3a2
feat(ssh): the owner records a user's Disconnect and refuses connects…
brennanb2025 0c2d369
fix(terminal): background connects wait for the user instead of redia…
brennanb2025 2909338
feat(workspace): panes say when the user's own Disconnect holds their…
brennanb2025 d3c821a
test(e2e): a user's Disconnect holds with a terminal open until the o…
brennanb2025 54c0bc0
test(ssh): pin the refusal after a queued wait, the intent strip, adm…
brennanb2025 7a42e7b
fix(ssh): a held-down host publishes as disconnected while Reset Rela…
brennanb2025 7599fa8
fix(terminal): a held-down pane waits for the user's Connect to finis…
brennanb2025 103dec3
fix(ssh): a failed terminate closes the cleanup transport of a host t…
brennanb2025 0336e20
test(ssh): a user's Connect during a failed terminate keeps its conne…
brennanb2025 6ef7fba
fix(ssh): ending a host's terminals dials and closes the relay in one…
brennanb2025 899107b
test(relay): a stop from a connection with no consumer session ends t…
brennanb2025 7910b1a
fix(ssh): end terminals and reset a relay without bringing a disconne…
brennanb2025 44fff19
test(ssh): a Connect behind End Terminals ends connected with its rel…
brennanb2025 2867f14
test(ssh): a Connect behind End Terminals also restores its forwards
brennanb2025 0dac851
fix(ssh): name a host the user disconnected in the quit prompt, file …
brennanb2025 48634a8
fix(file-explorer): reload a failed tree when the workspace's host co…
brennanb2025 6351544
fix(ssh): say closing does not end terminals on a host the user disco…
brennanb2025 344b92b
fix(file-explorer): keep the raw read error off screen while the host…
brennanb2025 9295ba4
test(file-explorer): pass the workspace id to the tree load effects
brennanb2025 b9951e1
fix(editor): show the connecting state, not a dropped read error, whi…
brennanb2025 30e8971
fix(i18n): name the disconnected host in the quit prompt's Japanese a…
brennanb2025 853925f
fix(editor): promise a reload on connect only for the file the retry …
brennanb2025 c89e029
Merge origin/main into brennanb2025/ssh-disconnect-sticks
brennanb2025 9df2f3b
test(e2e): the escape-hatch spec proves the user's Disconnect held, n…
brennanb2025 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import type { SshTarget } from '../../shared/ssh-types' | ||
| import { isRuntimeOwnedSshTarget } from '../../shared/execution-host' | ||
| import { getSshTargetRegistryStore } from '../ssh/ssh-target-registry' | ||
|
|
||
| type SshConnectionIntent = NonNullable<SshTarget['desiredConnection']> | ||
|
|
||
| /** True while the user's own Disconnect holds this host down. Runtime-owned targets never are. */ | ||
| export function isSshTargetDisconnectedByUser(targetId: string): boolean { | ||
| const target = getSshTargetRegistryStore()?.getTarget(targetId) | ||
| return ( | ||
| target !== undefined && | ||
| !isRuntimeOwnedSshTarget(target) && | ||
| target.desiredConnection === 'disconnected' | ||
| ) | ||
| } | ||
|
|
||
| /** | ||
| * Records what the user asked for on the target row itself, so it survives a restart and ends | ||
| * with the target. Only a user's Connect or Disconnect may call this — a network drop is never | ||
| * the user's intent (docs/reference/ssh-execution-boundary.md). | ||
| */ | ||
| export function recordSshConnectionIntent(targetId: string, intent: SshConnectionIntent): void { | ||
| const store = getSshTargetRegistryStore() | ||
| const target = store?.getTarget(targetId) | ||
| // Why ownership: a runtime-owned target's lifecycle belongs to the runtime layer, not the user. | ||
| if (!store || !target || isRuntimeOwnedSshTarget(target) || target.desiredConnection === intent) { | ||
| return | ||
| } | ||
| store.updateTarget(targetId, { desiredConnection: intent }) | ||
| } | ||
|
|
||
| export function sshTargetDisplayLabel(targetId: string): string { | ||
| return getSshTargetRegistryStore()?.getTarget(targetId)?.label ?? targetId | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.