Skip to content

fix: refuse uninstall of games outside a library folder - #303

Merged
fraa2a merged 1 commit into
mainfrom
fix/manual-import-uninstall-scope
Nov 6, 2026
Merged

fraa2a merged 1 commit into
mainfrom
fix/manual-import-uninstall-scope

Conversation

@fraa2a

@fraa2a fraa2a commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

What changed?

Data-loss finding from the review: a manual import records the executable's parent folder as installation_root, and uninstall recursively deleted it with no ownership check (e.g. ~/Applications, ~/.local/bin, D:\Games).

  • checked_target in game_uninstall.rs now requires the root to be a direct child of a registered library in game_libraries; otherwise uninstall is refused with a message pointing to "Rimuovi dalla libreria" plus manual deletion.
  • Applies to both get_game_uninstall_target (the dialog shows the error on open) and uninstall_game.
  • No new command or UI: the existing library-only removal (remove_game) is reused.

Trade-off: a manually imported game in its own dedicated folder outside any library is also refused, preferred over a fragile "other executables in the folder" heuristic.

Not changed: transfer still moves a manual import's whole parent folder (game_transfer.rs:119-136); left for a follow-up to avoid overlapping with #300. No textual conflicts with #300.

Validation

  • cargo test game_uninstall 11 passed; clippy and fmt clean.
  • New tests: folder_outside_a_library_is_rejected (shared folder with a second AppImage survives), root_containing_a_library_is_rejected (missing test from the report).
  • Manual test in the running app.
  • No unrelated changes.

Generated by Claude Code

Manually imported executables record their parent folder as the installation
root, which can be a shared folder such as ~/Applications. Uninstall now only
deletes folders directly inside a registered library; other games must be
removed from the library instead.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DGbCKVdcUfJfjZ93bYY9p3
@fraa2a
fraa2a merged commit a11439c into main Nov 6, 2026
7 checks passed
@fraa2a
fraa2a deleted the fix/manual-import-uninstall-scope branch November 6, 2026 16:09
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.

2 participants