Skip to content

fix(workspace): leave the legacy .vmark tree untouched on migration - #1586

Merged
xiaolai merged 1 commit into
mainfrom
fix/issue-1579-workspace-migration-preserves-files
Oct 20, 2026
Merged

xiaolai merged 1 commit into
mainfrom
fix/issue-1579-workspace-migration-preserves-files

Conversation

@xiaolai

@xiaolai xiaolai commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Opening a workspace no longer deletes .vmark/vmark.code-workspace, and no longer removes the .vmark directory, from the repository.
  • The migrated exclusion list now keeps .vmark; stripping it would expose a directory that still exists.
  • A regression test reads the workspace twice and asserts the legacy file is byte-for-byte unchanged.

Closes #1579

Why

read_config_in wrote the app-data config and then called cleanup_old_vmark, which deleted the legacy workspace file and tried to remove the directory. In a repository that tracks .vmark, the first open destroyed tracked files with no prompt and no undo.

Migration is now read-only with respect to the repository. It is still one-shot: the next read finds the app-data config and returns before the legacy branch.

What changed

  • src-tauri/src/workspace/legacy.rs: removed cleanup_old_vmark and clean_excludes; migration carries the legacy exclusion list over unchanged.
  • src-tauri/src/workspace/mod.rs: the durable app-data write no longer triggers cleanup; a failed write is still logged.
  • Tests: the io regression plus updated migration expectations; the deletion-only tests are gone with the function they tested.
  • .claude/feature-ledger.md: records the non-destructive migration.

Validation

  • cargo test --manifest-path src-tauri/Cargo.toml --lib workspace:: — 140 passed
  • cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
  • cargo fmt --manifest-path src-tauri/Cargo.toml --check
  • pnpm check:predelta

…WI-WS1.1)

`read_config_in` migrated `.vmark/vmark.code-workspace` into app data and then
called `cleanup_old_vmark`, which deleted the workspace file and removed the
directory. In a repository that tracks `.vmark`, opening the workspace silently
destroyed tracked files on first open.

Migration is now read-only with respect to the repository: the app-data copy is
written, and the legacy file and directory are left byte-for-byte intact. The
legacy exclusion list is carried over unchanged, because `.vmark` still exists
and stripping it would expose a tree the user had chosen to hide. The migration
is still one-shot: the next read finds the app-data config and returns before
the legacy branch.

The regression test reads the workspace twice and asserts both that the legacy
file is unchanged and that its content matches after the second read.

Fixes #1579
@xiaolai
xiaolai merged commit df4843a into main Oct 20, 2026
18 checks passed
@xiaolai
xiaolai deleted the fix/issue-1579-workspace-migration-preserves-files branch October 20, 2026 03:16
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.

[Bug] Opening a workspace deletes .vmark/vmark.code-workspace from the repository

1 participant