[Bug]: Classic sync client deletes local file instead of uploading after move into sync folder (macOS)
- Dominant language
- C++
- Stars
- 3.9k
- Forks
- 1k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 123
Description
### ⚠️ Before submitting, please verify the following: ⚠️
- [x] This is a **bug**, not a question or a configuration issue.
- [x] This issue is **not** already reported on Github (I've searched it).
- [x] Nextcloud Server and Desktop Client are **up to date**. See [Server Maintenance and Release Schedule](https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule) and [Desktop Releases](https://nextcloud.com/install/#install-clients) for supported versions.
- [x] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/)
### Bug description
When moving a file from outside the Nextcloud sync folder into it using macOS Finder, the desktop client (classic sync, non-VFS) recognizes the file as newly created, then immediately deletes it locally instead of uploading it to the server. The file is not moved to the server-side trash and not moved to the macOS Trash — it is permanently lost.
The activity log shows two consecutive entries:
✅ "You created XYZ.txt" — client detects the file locally
✖ "XYZ.txt synchronized" (large black X icon) — client deletes the file
The file is permanently deleted:
Not in macOS Trash
Not in Nextcloud server-side Trash
Not on the server at all
### Steps to reproduce
Use Nextcloud Desktop Client 4.0.7 in classic sync mode (non-VFS) on macOS
Move a file from outside the Nextcloud sync folder into it using Finder (drag & drop or mv)
Observe the activity log in the client tray
### Expected behavior
The file is uploaded to the server and appears in the activity log as "Synced".
### Which files are affected by this bug
test.sql
### Operating system
macOS
### Which version of the operating system you are running.
Tahoe 26.3.1
### Package
Official macOS 12+ universal pkg
### Nextcloud Server version
30.0.8.2
### Nextcloud Desktop Client version
4.0.7
### Is this bug present after an update or on a fresh install?
Updated from a minor version (ex. 3.16.1 to 3.16.2)
### Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
### Are you using an external user-backend?
- [ ] Default internal user-backend
- [ ] LDAP/ Active Directory
- [ ] SSO - SAML
- [ ] Other
### Nextcloud Server logs
```shell
```
### Additional info
Root cause hypothesis
Race condition in the sync engine on macOS: the FSEvents notification for the move is processed before the file is registered in the sync database. The engine sees a file present locally but absent remotely, and — instead of treating it as a new upload — issues a CSYNC_INSTRUCTION_REMOVE (local delete), interpreting the remote absence as the authoritative state.
This is consistent with issue #1630 (macOS move into sync folder not syncing subfolders) and the CSYNC_INSTRUCTION_REMOVE propagation observed in #9318, but differs in that it affects top-level files, uses classic sync (not VFS), and results in permanent data loss with no recovery path via Trash.
Contributor guide
Assessment
This issue has not been assessed yet.