fix(desktop): prevent deleted profile respawn - #88120
Merged
teknium1 merged 1 commit intoAug 17, 2026
Merged
Conversation
helix4u
marked this pull request as ready for review
August 17, 2026 03:49
19 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Prevents Hermes Desktop from recreating a named profile immediately after it is deleted.
The existing delete interception stopped only the legacy pool entry and routed the DELETE request itself away from the deleted profile. The connections registry can also hold an explicit-local backend under
conn:local::<profile>, while concurrent or delayed renderer work can already be waiting to start another backend. Either path can runensure_hermes_home()after the profile directory is removed and resurrect it.This change:
The fix is generic Desktop lifecycle coordination. It does not add plugin-specific behavior.
Related Issue
Regression follow-up to #52279.
Type of Change
Changes Made
apps/desktop/electron/main.ts: coordinate deletion with both local backend pool scopes and guard the final local spawn boundary.apps/desktop/electron/profile-delete-routing.ts: add the process-local deletion gate, final local-start validation, and local pool-key enumeration.apps/desktop/electron/profile-delete-routing.test.ts: cover concurrent deletion leases, deferred starts, delayed retries after directory removal, and both pool-key shapes.How to Test
host.deleteProfilepath while renderer connection work is active.--profile <deleted-name>.Focused verification run:
npm run typecheckeslint electron/main.ts electron/profile-delete-routing.ts electron/profile-delete-routing.test.tsvitest run --project electron electron/profile-delete-routing.test.ts(19 passed)Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
The full Electron project run completed with 1,259 passing tests and 28 pre-existing Windows-host failures in POSIX file-mode, SSH control-socket, POSIX path, and temp-directory cleanup cases. The focused regression suite, targeted lint, and complete Desktop typecheck pass.