Skip to content

fix(cua-driver): write the update-check cache to the canonical home - #3032

Merged
f-trycua merged 3 commits into
mainfrom
codex/fix-version-check-home
Aug 13, 2026
Merged

fix(cua-driver): write the update-check cache to the canonical home#3032
f-trycua merged 3 commits into
mainfrom
codex/fix-version-check-home

Conversation

@injaneity

Copy link
Copy Markdown
Collaborator

Summary

  • write version_check.json through bundle::user_home_subdirectory(), so release builds use the canonical ~/.cua-driver/ home
  • migrate an existing cache from ~/.cua-driver-rs/ while preserving dismissed-version state
  • keep the legacy cache intact when canonical-directory creation or the move fails
  • cover canonical placement, successful migration, non-destructive cleanup, and deterministic migration failure

Root cause

The driver home rename was only partially applied. Telemetry, skills, and configuration moved to the canonical home, but the update-check cache retained a hard-coded release path under .cua-driver-rs. Every update check therefore recreated the legacy directory after installers and other migrations removed it.

The installer-side false-positive and self-termination behavior was fixed in #2805. This change removes the remaining driver writer that kept resurrecting the legacy home.

Safety

Migration cleanup now runs only when a canonical cache is already a file or the rename succeeds. If the destination cannot be created or the move fails, the legacy cache remains untouched so dismissed_versions is not lost.

Attribution

Salvaged from #3002 by @rsyuzyov. The contributor's commit was applied with git cherry-pick -x, preserving Roman Syuzyov as its author and recording source commit 1c0a2ba60994ca00a7cc7d60d3f330dbb4f0799d. The follow-up safety commit also credits Roman as coauthor.

Validation

  • cargo fmt --all -- --check — passed with Rust 1.97.1
  • cargo test -p cua-driver --bin cua-driver version_check — attempted, but this local Windows image lacks Microsoft C++ Build Tools and the Windows SDK; compilation stopped at the linker before project tests could run. PR CI must provide the executable test evidence.

Refs #2803

rsyuzyov and others added 2 commits August 10, 2026 02:03
`version_check` still resolved its cache under the pre-rename
`~/.cua-driver-rs/`, while `telemetry.rs` and `skills.rs` had moved to
`~/.cua-driver/` and actively migrate away from the old home. Even
`read_config_flag` in this same file already reads the config from
`bundle::user_home_subdirectory()` — only the cache path lagged behind.

The effect is that every current install re-creates the legacy home the
installer just swept, so the telemetry migration can never finish and
`~/.cua-driver-rs` looks like a legacy-layout marker on machines that have
only ever run current versions (the root cause discussed in #2803, whose
installer half shipped in #2805).

Resolve the cache through `bundle::user_home_subdirectory()` (which also
covers the `.cua-driver-local` source-build case the old inline branch
handled), and migrate a cache left in the pre-rename home on first read:
move the file, then drop the directory only if it is empty, matching
`migrate_legacy_telemetry_home`. Keeping the file is worth the few lines
because it carries the dismissed-version list.

(cherry picked from commit 1c0a2ba)
Keep the legacy version-check cache unless the canonical cache already exists or the move succeeds, and cover a deterministic destination failure.

Co-authored-by: Roman Syuzyov <7994115+rsyuzyov@users.noreply.github.com>
@f-trycua
f-trycua merged commit 69e5774 into main Aug 13, 2026
24 checks passed
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.

3 participants