fix(cua-driver): write the update-check cache to the canonical home - #3032
Merged
Conversation
`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>
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.
Summary
version_check.jsonthroughbundle::user_home_subdirectory(), so release builds use the canonical~/.cua-driver/home~/.cua-driver-rs/while preserving dismissed-version stateRoot 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_versionsis 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 commit1c0a2ba60994ca00a7cc7d60d3f330dbb4f0799d. The follow-up safety commit also credits Roman as coauthor.Validation
cargo fmt --all -- --check— passed with Rust 1.97.1cargo 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