syncthing-android
syncthing-android copied to clipboard
Data loss: discarding conflicts
Syncthing android seems to discard its own changes when a conflicting change with a later timestamp comes from another system. I'm testing with Syncthing Android on my phone and Syncthing on a linux PC.
To reproduce
- Create a test file on one device, which gets synced to both.
- Disconnect one device from network, or pause syncing
- Make conflicting modifications on both devices.
- Re-establish connection and syncing
- If the modification on the android device in step 3 was later than the PC, a .conflict file will be correctly created; however if the file on the android device was modified first, it will get updated with the conflicting modification from PC, losing the changes on android.
Version Information
App Version: 0.10.4
Syncthing Version: v0.14.43
Android Version: Android 7.1.2 / LineageOS 14.1 / Motorola Moto G 2014
PC Syncthing Version: v0.14.44, Linux (64 bit)
I tried to reproduce this with the exact same version information (except that device is Samsung Galaxy S5) but in both cases (first modification on Android/PC) I get a conflict file with the content from the file modified earlier (and the conflict file appears on both devices).
I just tried with another device (Motorola Moto G5S Plus, with stock android; also updated PC Syncthing to 0.14.45) and consistently reproduce the same behavior (conflicting modifications from android device are discarded when done earlier).
Going through log files, the only relevant entry I can locate is in the android log, after connection entry (test.txt is the file I'm modifying on both sides):
03-09 15:34:46.068 I/EventProcessor( 6787): Rescanned file via MediaScanner: /storage/emulated/0/Android/data/com.nutomic.syncthingandroid/files/default/test.txt
Version Information
App Version: 0.10.4
Syncthing Version: v0.14.43
Android Version: Android 7.1.1 / Stock Motorola Moto G5S Plus
PC Syncthing Version: v0.14.45, Linux (64 bit)
@dkaparis Can you still reproduce this issue with the current version 0.10.8 available on play store? If that does not help, you can export your config in the apps menu and try a debug build importing the config. Link [removed] Please backup your data first, as the debug build may contain bugs as it is based on a release candidate (0.14.47rc3+commit).
Yes, I still reproduce it with 0.10.8 on the phone and 0.14.46 on PC. I'll try the release candidate and report back when I get around to it.
I am pretty sure the RC or whatever won't help here as there hasn't been any changes in that department, yet someone else needs to validate the reproducer.
Nothing hits my head as to why this happens, as the implementation is the same across platforms.
@dkaparis In which paths are the folders configured you are syncing? I mean it like this:
- PC - Windows machine with NTFS USB thumb drive - E:\mysync
- Android - /storage/emulated/0/my-folder
I tested with two different PC configurations, with identical results:
- Debian machine, v0.14.41, ext4 filesystem, directory path /home/syncthing/Sync
- Arch-linux machine, v0.14.46, ext4 filesystem under LUKS encrypted volume
Android configuration: Internal storage (no SD card), path: /storage/emulated/0/Android/data/com.nutomic.syncthingandroid/files/default/
@dkaparis Thanks for the details. Does it help setting ignore permissions on the linux partners?
Just tested with "Ignore Permissions" checked for the folder on PC - same behavior.
You reproduced with 2 pcs and no android involved?
No, with 2 PCs conflict files are always created properly.
I'm having this issue with two PCs, specifically when I just save a file without changing it. I have a text file with my todos in it, if I open the app I'm using to edit it on my desktop while my laptop is off, it'll autosave the text file, which overwrites all the changes I made that day while disconnected from my home network.
My laptop is running: v0.14.49, Linux (64 bit) on Arch Linux My desktop is running: v0.14.49, Linux (64 bit) on Ubuntu 17.10
Could it be that the file name is 1533676510.sync-conflict-20180823-021915-NJNTDTX.m!note
because I started writing in a sync conflict version a while back?
Saving a file without changing it still counts as a change.
Yeah, this issue is that it's overwriting the older version of a file instead of making a sync conflict. That's what's happening here.
If the only difference is the modification time then it makes sense?
Essentially what I am trying to say is that auto-save will bump the version of the file, which is enough to cause a conflict with some device which modified the file offline. Yet just autosaving with the same content between two devices even if one is offline I don't think causes conflicts, as content is the same.
Ah, I understand now, that could definitely be a cause. Now I wish I knew Go so I could go and fix this.
It's intended to work this way, so there is nothing to fix.
Hi.
Same problem here, but inverse behavior. The problem is like what @dkaparis said in first post of this page, but the difference is:
If the modification on the android device was later than the PC, no conflict file created and PC changes will be loss. But when PC changes is later than android, conflict file will created. It's inverse of what @dkaparis said.
Android device: Android 7.0, Samsung Galaxy J5 Prime PC: Void Linux i686 Syncthing on PC: v1.1.3, Linux (32 bit) Syncthing on Android: 1.1.2.1
Hi! I'm also losing changes in a todo.txt file on a regular basis. Since it doesn't happen every time I make a change, it is proving tricky to identify where the problem occurs. I'm using:
Syncthing-Android v1.1.4 SyncTrayzor 1.1.23 on Windows Syncthing 1.1.4 on Linux
If I can narrow it down, I'll post back.
This should be fixed in the release candidate I think, barring your own fatfingering and modifying stuff on two devices simultaniously.
I thought I was experiencing the same bug but then found that conflict files were being created on the phone I just wasn't aware of that, because I was used to getting notification when this happens on PC. When modification on the phone is later than on PC, conflict file is being created silently without notification on desktop or phone. While if modification on PC is later, I get notification on PC.
It would be nice to get conflict notifications on the phone too. Maybe that would be enough to fix this.