Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| clone = VirtualFile(name=node.name, metadata=dict(node.metadata)) | ||
| clone.policy = self._clone_policy(node.policy) | ||
| clone.write(node.read(self)) | ||
| clone.version = node.version | ||
| return clone |
There was a problem hiding this comment.
Advance version when overwriting via copy
When _clone_node copies a file or directory it now copies the source version (sandfs/vfs.py lines 466‑469). During copy, overwriting an existing path removes the destination node and adds this clone without incrementing the version. As a result, a destination file that previously had version 1 is still reported as version 1 after being overwritten, so clients using optimistic concurrency (see tests/test_persistence.py lines 8‑13) cannot detect the change—write_file(..., expected_version=1) will succeed even though another operation replaced the file in between. Copying over an existing file should advance the destination’s version just like any other write to keep versions monotonic; mirroring the source version breaks that guarantee.
Useful? React with 👍 / 👎.
|
Summary
Testing
|
Summary
Testing
Codex Task