Skip to content

Android: Sync conflict not detected: newest copy is propagated to other clients #4305

Closed as not planned

Description

@tomtom

Let's say I have three devices (1 linux [A] + 2 android [B, C] if this is relevant). All devices are in sync. I switch off syncthing on all 3 devices.

  1. I edit file X on device B, then C, then A. So file X has changed on all 3 devices.
  2. I switch on syncthing on B, C, A.
  3. I wait
  4. After a while, the version of file X edited last on device A is propagated to B and C. There is not copy of the old version of X on B and C indicating a synchronization conflict.

I personally would expect to end up with at least two files indicating a synchronization conflict.

Is the situation describe in step 4 the expected outcome? Are my expectations about how synchting works wrong?

Activity

  1. calmh commented on Aug 17, 2017

    @calmh
    Member

    It is expected that you should get sync conflicts. I'm 99% sure that

    2 android [B, C] if this is relevant

    is the problem as Android doesn't keep proper mtime and we have a bunch of hacks around that. I thought those hacks worked, but there may be something else interacting here as well maybe, up to and including your changes not actually updating the mtime, making the change invisible to Syncthing. I'd lower my expectations on data integrity on the Android side.

  2. calmh commented on Aug 17, 2017

    @calmh
    Member

    I tested your scenario manually with three instances, one file changed on all three sides while Syncthing is off, then starting all three and got the expected result:

    -rw-r--r--   1 jb  staff   36 Aug 17 12:00 test-appendfile
    -rw-r--r--   1 jb  staff   36 Aug 17 12:00 test-appendfile.sync-conflict-20170817-120105-373HSRP
    -rw-r--r--   1 jb  staff   36 Aug 17 12:00 test-appendfile.sync-conflict-20170817-120105-MRIW7OK
    

    So I'm fairly sure this is specific to either Android in general or your test on Android in particular. Which doesn't help you much, but perhaps narrows this down for someone who wants to troubleshoot it.

  3. changed the title [-]Sync conflict not detected: newest copy is propagated to other clients[/-] [+]Android: Sync conflict not detected: newest copy is propagated to other clients[/+] on Aug 17, 2017
  4. added
    bug
    on Aug 17, 2017
  5. added this to the milestone on Aug 17, 2017
  6. tomtom commented on Aug 18, 2017

    @tomtom
    Author

    Does the DB also contain info on file sizes? If so, a file could be considered unchanged only if the mtime is the same (or unknown on Android?) and if the file size hasn't changed. This wouldn't get mere replacements but that's better than the current situation.

  7. calmh commented on Aug 18, 2017

    @calmh
    Member

    The check is done on mtime, size and permissions (already).

  8. AudriusButkevicius commented on Aug 22, 2017

    @AudriusButkevicius
    Member

    So I think this is fixed in the RC.

  9. calmh commented on Aug 22, 2017

    @calmh
    Member

    I doubt it as the description includes stopping syncthing, doing the modification everywhere, then starting syncthing. The scan should unconditionally happen when it starts. I don't know if there's a sane way to test the RC on Android.

  10. AudriusButkevicius commented on Sep 5, 2017

    @AudriusButkevicius
    Member

    @tomtom can you please test the scenario again once android version is released?

  11. tomtom commented on Sep 7, 2017

    @tomtom
    Author

    It tried the following (similar) scenario: 3 devices (1 linux [A] + 2 android [B, C]).

    All devices are in sync. I switch off syncthing on all 3 devices.

    1. I edit file X on device B, then C. So file X has changed on all 2 android devices.
    2. I switch on syncthing on B, C, A.
    3. I wait
    4. After a while, the version of file X edited last on device C is propagated to A and B. There is no copy of the old version of X on B and C indicating a synchronization conflict.

    I would expect to see at least one file indicating a synchronization conflict.

  12. AudriusButkevicius commented on Sep 7, 2017

    @AudriusButkevicius
    Member

    To be honest, sounds like Android. I suspect if you doit only on linux and android it should work.

  13. snugghash commented on Oct 29, 2017

    @snugghash
    Contributor

    The check is done on mtime, size and permissions (already).

    Can we not add a hash/digest comparison? If that's too much additional computation, we could do it only if there are multiple android devices when changes are detected and checking for conflicts.

  14. AudriusButkevicius commented on Oct 29, 2017

    @AudriusButkevicius
    Member

    There is no indication that a device is an android device.
    Hash check means reading each file in full which is incredibly expensive, plus you'd have to store the digest somewhere.

  15. removed this from the milestone on Feb 11, 2018
  16. added theissue type on May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions