Skip to content

fix(fspy): ignore malformed tracked paths without panicking#330

Open
SegaraRai wants to merge 4 commits intovoidzero-dev:mainfrom
SegaraRai:fix/issue-325
Open

fix(fspy): ignore malformed tracked paths without panicking#330
SegaraRai wants to merge 4 commits intovoidzero-dev:mainfrom
SegaraRai:fix/issue-325

Conversation

@SegaraRai
Copy link
Copy Markdown

Summary

Fixes #325.

Windows file access tracking could panic when fspy observed a malformed path such as foo/C:/bar. The path is initially accepted as relative, but lexical cleanup can turn it into a drive-prefixed path that no longer satisfies RelativePath invariants.

  • Make RelativePath::clean() fallible instead of panicking when cleanup produces a non-relative path
  • Ignore fspy-observed paths that cannot be represented as valid workspace-relative inputs after cleanup
  • Add a unit repro for the malformed Windows drive-path case
  • Add a Windows-only E2E snapshot repro through the fspy input-inference path
  • Add a changelog entry

Test plan

  • cargo test -p vite_path clean_malformed_drive_path
  • cargo test -p vite_task malformed_windows_drive_path_after_workspace_strip_is_ignored
  • cargo test -p vite_task_bin --test e2e_snapshots -- malformed-fspy-path
  • cargo check -p vite_path -p vite_task

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] Panic in cache path tracking when a malformed observed path reaches RelativePathBuf::clean()

1 participant