[PR #1686] [MERGED] Launcher: a version removal retries a locked file and leaves the UI thread #3685

Closed
opened 2026-11-03 04:11:25 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1686
Author: @Domanffe
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: fix/launcher-remove-retry


📝 Commits (3)

  • a93c150 Launcher: a version removal retries a locked file and leaves the UI thread
  • a61c7fa Launcher: a version being removed shows Removing… instead of its buttons
  • 71f3c23 Merge main into the launcher removal branch

📊 Changes

1 file changed (+13 additions, -1 deletions)

View changed files

📝 launcher/src/backend.rs (+13 -1)

📄 Description

🤖 Agent

Two complaints about removing a version, one cause each.

Deleting a version reported "Отказано в доступе. (os error 5)" while the folder did disappear. backend::remove was a single remove_dir_all, and on Windows that stops at the first file another process still holds, after having already deleted the rest. remove now retries five times, 250 ms apart, and treats a folder that is already gone as done, so a lock that clears within a second reads as success and a real one still reports the error.

The window froze during deletion because App::remove called remove_version straight from the update loop, unlike install, which already spawns a thread. The removal now goes to a thread and reports back with a new Msg::Removed, the row stays in the list while it runs (removing), and the list and selection refresh when it lands.

Measured on a debug build of this branch, driving the CLI (horizon-launcher remove <tag>) with an isolated HORIZON_LAUNCHER_HOME and a file held open with an exclusive handle, which is what a scan or the running client does:

hold on one file result
6 s, longer than all five attempts error: ... файл занят другим процессом (os error 32), exit 1, folder kept
600 ms Removed vtestB., exit 0, folder gone

The first row is the honest failure that should still be shown; the second is the case the report hit. The freeze half is structural and not measured: the UI thread no longer runs the deletion at all.

Nothing else about removal changes: remove_version still moves the selection to the newest remaining version, and the CLI path stays synchronous, since it has no window to stall.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1686 **Author:** [@Domanffe](https://github.com/Domanffe) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/launcher-remove-retry` --- ### 📝 Commits (3) - [`a93c150`](https://github.com/horizon-rust/horizon/commit/a93c1507f9ff1ee64b33f0298913ee7947ae2f5d) Launcher: a version removal retries a locked file and leaves the UI thread - [`a61c7fa`](https://github.com/horizon-rust/horizon/commit/a61c7faa230357ab24c512c1d456ac95e5c8300c) Launcher: a version being removed shows Removing… instead of its buttons - [`71f3c23`](https://github.com/horizon-rust/horizon/commit/71f3c23dd9f7ed6b1bddf701f700f41014dd4cbb) Merge main into the launcher removal branch ### 📊 Changes **1 file changed** (+13 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `launcher/src/backend.rs` (+13 -1) </details> ### 📄 Description 🤖 Agent Two complaints about removing a version, one cause each. Deleting a version reported "Отказано в доступе. (os error 5)" while the folder did disappear. `backend::remove` was a single `remove_dir_all`, and on Windows that stops at the first file another process still holds, after having already deleted the rest. `remove` now retries five times, 250 ms apart, and treats a folder that is already gone as done, so a lock that clears within a second reads as success and a real one still reports the error. The window froze during deletion because `App::remove` called `remove_version` straight from the update loop, unlike `install`, which already spawns a thread. The removal now goes to a thread and reports back with a new `Msg::Removed`, the row stays in the list while it runs (`removing`), and the list and selection refresh when it lands. Measured on a debug build of this branch, driving the CLI (`horizon-launcher remove <tag>`) with an isolated `HORIZON_LAUNCHER_HOME` and a file held open with an exclusive handle, which is what a scan or the running client does: | hold on one file | result | | --- | --- | | 6 s, longer than all five attempts | `error: ... файл занят другим процессом (os error 32)`, exit 1, folder kept | | 600 ms | `Removed vtestB.`, exit 0, folder gone | The first row is the honest failure that should still be shown; the second is the case the report hit. The freeze half is structural and not measured: the UI thread no longer runs the deletion at all. Nothing else about removal changes: `remove_version` still moves the selection to the newest remaining version, and the CLI path stays synchronous, since it has no window to stall. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:11:25 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3685
No description provided.