Skip to content

[BUG] Card sync does not work as expected #657

Description

@Phaust94

Which app is your issue for

CardWallet

Version

1.12.2

What platform are you using?

iOS

OS Version

26.4.2

What happened?

iOS card sync overwrites remote state
STR:

  1. On Android, create a 2 cards in 1 folder.
  2. Add sync to webdav, then click "sync"
  3. On a fresh iOS device, add webdav and click "sync". Observe both cards being downloaded.
  4. Back on Android, delete one of the cards, click "sync"
  5. Verify that the cards are deleted by opening the sync folder in the webdav client and seeing that there is only one folder (= 1 card data) in the sync folder.
  6. Open iOS app, click "sync"

EXP: Remote changes from Android get pulled in, only 1 card remains
ACT: iOS state overwrites remote state, the card that was deleted gets re-uploaded to the webdav folder.

What I expect is that the priority (local vs remote state) get determined based on 2 timestamp fields: updated_time and sync_time, set on each of the cards both locally and on a remote.
Scenario A (Upload): Device A looks at a card and sees updated_time is newer than its last sync_time. It checks remote, and the remote version hasn't changed (remote sync_time = local sync_time). The Device A simply overwrites the file in the remote.
Scenario B (Download): Device B checks remote and finds a card where the remote updated_time is newer than Device B local sync_time. The Device B downloads it and updates its local database.
In case local updated_time is newer than local sync_time and remote sync_time is newer than local sync_time - a conflict is detected, remote changes are pulled and overwrite local changes, and also a new folder conflicts is created, and the local version of a conflicting card is moved there.
I hope it makes sense.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions