Skip to content

fix(desktop): support redirected Windows app data roots - #747

Merged
yyjeqhc merged 4 commits into
mainfrom
fix/issue-743-desktop-data-root
Sep 28, 2026
Merged

yyjeqhc merged 4 commits into
mainfrom
fix/issue-743-desktop-data-root

Conversation

@swjnxyf

@swjnxyf swjnxyf commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • resolve Windows Desktop app-data ancestors to their physical filesystem location so redirected profiles such as C:\Users\<user> -> D:\Users\<user> can initialize normally
  • keep one effective Desktop data root for state, secrets, local runtime, connections, provider/coding-agent state, updates, diagnostics, and recovery
  • add WEBCODEX_DESKTOP_DATA_DIR as an absolute-path recovery/debug override
  • expose only bounded diagnostics for data-root source and whether physical resolution changed the path
  • preserve the CLI credential-path security boundary instead of weakening Junction/reparse checks

Review hardening

The review found two reparse-point edge cases and fixes them in a separate commit:

  • the final Desktop-owned data-root component is never canonicalized through a Junction/symlink; an existing reparse-point root is rejected
  • ancestor discovery uses symlink_metadata rather than Path::exists(), so a dangling Junction cannot be misclassified as a missing tail and rebuilt through

Legitimate redirected profile / LocalAppData ancestors can still resolve to their physical location before the final app-owned root is appended.

Validation

Review/final-state validation on Windows:

  • cargo test --manifest-path apps/desktop/src-tauri/Cargo.toml — 218 passed, 0 failed, 6 ignored
  • cargo check --locked --manifest-path apps/desktop/src-tauri/Cargo.toml --all-targets — passed
  • Desktop data-root/Junction regressions include redirected ancestor, nested Junction, missing tail, final-root Junction rejection, dangling Junction rejection, override validation, and local runtime path derivation
  • cargo test -p webcodex-cli real_windows_directory_tree_accepts_std_canonical_verbatim_form — passed
  • cargo fmt --manifest-path apps/desktop/src-tauri/Cargo.toml -- --check — passed
  • git diff --check — passed

The implementation does not relax ensure_real_directory_tree or the existing credential symlink/Junction policy.

Fixes #743

Resolve the Desktop logical app-local-data root to one physical Windows filesystem root before constructing Desktop state, while preserving the CLI credential-path security boundary. Add the WEBCODEX_DESKTOP_DATA_DIR recovery override, bounded diagnostics, Junction regressions, and documentation.

Fixes #743
@yyjeqhc
yyjeqhc merged commit f939349 into main Sep 28, 2026
16 checks passed
@yyjeqhc
yyjeqhc deleted the fix/issue-743-desktop-data-root branch September 28, 2026 03:18
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.

[Windows][Desktop] Local setup fails when USERPROFILE is redirected through a Junction

2 participants