Skip to content

fs: Fix no-overwrite rename races#51090

Merged
smitbarmase merged 3 commits intomainfrom
fix-project-panel-overwrite-bug
Mar 9, 2026
Merged

fs: Fix no-overwrite rename races#51090
smitbarmase merged 3 commits intomainfrom
fix-project-panel-overwrite-bug

Conversation

@smitbarmase
Copy link
Copy Markdown
Member

@smitbarmase smitbarmase commented Mar 9, 2026

Closes #46661

This PR changes fs.rename to use the platform’s atomic no-overwrite rename on all platforms when overwrite is false. This fixes a case where concurrent renames to the same target could race past a separate metadata check and end up overwriting each other.

In Project Panel, we can still rename entries in parallel without worrying about OS internals not handling it correctly or making these renames sequential.

Release Notes:

  • Fixed an issue in the Project Panel where conflicting file moves could overwrite each other instead of leaving the losing file in place.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 9, 2026
@zed-community-bot zed-community-bot bot added the staff Pull requests authored by a current member of Zed staff label Mar 9, 2026
@smitbarmase smitbarmase merged commit 4e9e944 into main Mar 9, 2026
29 checks passed
@smitbarmase smitbarmase deleted the fix-project-panel-overwrite-bug branch March 9, 2026 22:26
smitbarmase added a commit that referenced this pull request Mar 9, 2026
…51138)

Follow-up #51090

Adds workspace error notifications for project panel drag-and-drop moves
that fail on rename conflicts.

Release Notes:

- N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Files with the same name disappear silently when moved together

1 participant