Handle local<->server file conflicts
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 2.5k
- Forks
- 1k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 13
Description
I would like to request that conflicting file management be added to the iOS app.
The Nextcloud Desktop app does this whenever it detects that changes have occurred to a file on both the local client and the remote server between synchronization runs. Information on this is documented here: https://docs.nextcloud.com/desktop/2.5/conflicts.html
While testing and reporting a syncing bug (#904), I discovered that the iOS app doesn't seem to do any conflict resolution in that situation. If you follow the steps outlined below, the iOS app seems to always overwrite the server's copy of a file even if the server contains newer changes that the iOS app hasn't yet downloaded. The iOS app will ignore those changes and upload its own locally changed copy without notifying the user that data on the server is being lost.
I would like to see the iOS app handle conflicts similarly to how the desktop app handles them. The desktop app notifies the user that a conflict exists, then proceeds to download the server's copy of the file alongside its own local edits. The server's copy takes priority, meaning it maintains the original file name while the local copy is renamed using a timestamp to differentiate the files. For example, mydata (conflicted copy 2018-04-10 093612).txt It is then left up to the user to decide which version should be kept.
The only difference I would like to see in how the iOS app handles conflicts vs how the desktop app handles conflicts is I believe the iOS app should upload both conflicting copies of the file to the server by default. The desktop app currently suspends syncing of both files, assuming that the user wants to deal with the conflict locally on the desktop before syncing resumes. On a mobile device, however, we should not make this assumption. The user may want to analyze the conflicting files on a different device (ie. a desktop with a larger screen), so we should make both copies available to do so. It seems the rationale behind suspending syncing on the desktop app is to avoid confusing other users in a shared folder situation. This seems like a valid concern so perhaps an option should be provided to disable uploading conflicts.
Steps to reproduce
- Prepare a test file. I created a file on my desktop and viewed it within the iOS app to make sure it was locally cached there.
- Put your iOS device into airplane mode and disable wifi. This simulates a situation where you have no service and only have access to the locally cached version of this file.
- Edit the file on your iOS device.
- Edit the file on your desktop.
- Disable airplane mode on your iOS device.
- At this point, by viewing the file on your Nextcloud server via the web interface, you can see that your iOS device ignored the edits that were uploaded to the server while the iOS device was in airplane mode. It uploaded its own edits, overwriting the conflicting edits on the server.
iOS version
12.3.1
App version
2.23.7.9
Server configuration
Operating system:
Ubuntu Server 18.04
Web server:
Database:
mysql 5.7.26
PHP version:
7.2.19
Nextcloud version: (see Nextcloud admin page)
16.0.2 installed from snap
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No iOS file, test, or entry point is named in the issue. Start by reproducing the airplane-mode conflict sequence and reviewing the linked desktop conflict behavior and issue #904. Done means the app detects both edits, preserves the server copy, creates a distinct local copy, and uploads both copies by default or exposes the proposed opt-out.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100