nextcloud / nextcloud/desktop

[Bug]: new files and folders being synced back from server after renaming them on the macOS client

Open
#6,500 23 comments 10 reactions 1 assignee Claimed by @camilasan View on GitHub
bug feature: :arrows_counterclockwise: sync engine
Dominant language
C++
Stars
3.9k
Forks
1k
Avg merge
1d 21h
Merged PRs (30d)
127

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

I (and other colleagues at work) experiencing strange behaviour of nextcloud desktop client for macOS when
- creating new folders
- duplicating folders or files
- and renaming the new folder/file immediately after creation/duplication.
The new file/folder is synced immediately to the server while the user renames the file or folder.
The renamed folder/file most of the time stays but the originally created/duplicated folder/file is being synced back from the server either in the meantime or up to 5 seconds after the file/folder was renamed and also synced to the server.
On rare occasions (I only observed this twice) the renamed file/folder vanishes and get replaced by the originally duplicated one.

This behavior was first observed about 10 months or so back in early 2023 on my MacBook Pro M1 Max under macOS 12.6.4 and Nextcloud Desktop client 3.6.6 or 3.7.3 i think. It persists til this day with macOS 14.3.1 and DT-client 3.12.0.
Other colleagues have same issues on older and newer MacBooks (intel and apple silicon) too.

I searched the issues database and found similar behaviors for the windows client open since 2022 and the macOS client but with VFS enabled which we have not!
- #5278
- #5420
- #5899

There are two feature requests being made wich could potentially circumvent this behavior:
- #6203
- #6366

I think the better way would be to track the local inode number + name for the folder/file being synced and check if it was renamed in the meanwhile before syncing back the file/folder from the server with the previous name and instead push the new name to the server (and subsequent clients)

### Steps to reproduce

1. Go in an shared folder
2. Create a new folder in finder (command+N)
3. Rename this folder (return, enter new name than return)
4. A couple of seconds later the Newly created folder reappears besides the renamed one
The same happens if you duplicate and rename the duplicated folder or existing file.

### Expected behavior

The desktop client should recognise the renaming of the file/folder and not sync it back from the server because the old filename does not exist any more due to the renaming.

### Which files are affected by this bug

any new or duplicated file/folder being renamed while syncing

### Operating system

Mac OS

### Which version of the operating system you are running.

several from 12.6.x to 14.3.x

### Package

Appimage

### Nextcloud Server version

25.0.3 (was same on 24.x)

### Nextcloud Desktop Client version

3.6.6 - 3.12

### Is this bug present after an update or on a fresh install?

Updated to a major version (ex. 3.3.6 to 3.4.0)

### Are you using the Nextcloud Server Encryption module?

Encryption is Enabled

### Are you using an external user-backend?

- [ ] Default internal user-backend
- [ ] LDAP/ Active Directory
- [ ] SSO - SAML
- [ ] Other

### Nextcloud Server logs

_No response_

### Additional info

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.