Skip to content

fix(client): remove update leftovers on uninstall and after a verified boot - #2343

Merged
danylo-babenko-flamingo merged 8 commits into
mainfrom
fix/uninstall-leftovers
Sep 23, 2026
Merged

danylo-babenko-flamingo merged 8 commits into
mainfrom
fix/uninstall-leftovers

Conversation

@danylo-babenko-flamingo

@danylo-babenko-flamingo danylo-babenko-flamingo commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

openframe-client uninstall removes the binary but not the copies the updater leaves next to it: .lkg (last-known-good reserve), .prev (pre-swap copy, never deleted on success), .old, and a legacy .bak. On one machine that was three stale binaries, 62 MB. Because bin\ is not empty afterwards, the Windows cleanup keeps C:\Program Files\OpenFrame. The updater's temp scripts and staging directories are also left, since they are only swept on the next client start, which never comes after an uninstall. Package-manager uninstalls (Homebrew, Chocolatey, winget) inherit the same leftovers.

Fix

  • uninstall.rs: sweep every sibling named .* in the binary's directory (private helper, Windows and macOS only). openframe-client-updater is not matched. Runs before the Windows cleanup script so the empty-folder removal works again. Prefix match on purpose: every file written next to the binary is an update artefact, and an enumerated suffix list would leave the next one behind again.
  • uninstall.rs: sweep the updater's temp leftovers regardless of age via UpdateCleanupService::sweep_temp_leftovers(None) (the routine cleanup_all keeps its one-hour gate); the service takes the install path (for_binary) instead of current_exe().
  • UpdateHandlerService::handle_success: delete .prev right after the last-known-good anchor is promoted. The update scripts are unchanged; from that point rollback uses .lkg and nothing reads .prev.
  • Tests in platform/uninstall_tests.rs (sibling sweep) and services/update_cleanup_service_tests.rs (.prev removal, backup sweep).

@danylo-babenko-flamingo danylo-babenko-flamingo changed the title Fix/uninstall leftovers fix(client): remove update leftovers on uninstall and after a verified boot Sep 23, 2026
@danylo-babenko-flamingo
danylo-babenko-flamingo marked this pull request as ready for review September 23, 2026 12:12
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🦩 Flamingo Code Review

1 finding(s) — 0 action required · 1 recommended · 0 informational

Mode: advisory · 1 defect(s) outside any rule

Inline comments: 1 new


Need another pass? Commits pushed after this review are not reviewed automatically.

  • Review the new commits — the commits added since this review
  • Review the whole diff again — ignoring what was already reviewed

Prefer typing? Comment @flamingo-review, or @flamingo-review full. To review every push on this pull request, add the flamingo-review-always label.

React 👍/👎 on inline comments to teach the reviewer.

Started 2026-09-23 16:04 UTC · updated 2026-09-23 16:05 UTC · workflow run

@danylo-babenko-flamingo
danylo-babenko-flamingo merged commit 2237d7b into main Sep 23, 2026
13 of 14 checks passed
@danylo-babenko-flamingo
danylo-babenko-flamingo deleted the fix/uninstall-leftovers branch September 23, 2026 19:28
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