Deleted CloudKit records Reappear

前端 未结 2 1451
孤独总比滥情好
孤独总比滥情好 2021-02-07 12:50

I\'m building an iOS application using CloudKit.

It should allow a user to add, edit and delete Products in the cloud. The user can organize these in Folder

2条回答
  •  走了就别回头了
    2021-02-07 13:33

    This might happen because the dashboard trace below suggests Apple use the Tombstone technique for replicating deletes across a distributed database. One of the nodes might have a bug or an old software version and is syncing the tombstone false field back across the system, causing the record to undelete itself. Or maybe something your code is doing is accidentally bringing these deleted records back to life? A workaround would be to use your own soft-delete boolean field and see how that behaves.

    [{
        "results": [{
            "tombstone": false
            "id": "NewItem",
            "etag": "ibgs5bpj",
            "recordType": "Items",
            "fields": {
                "name": "Malc",
                "location": {
                    "latitude": 38.0,
                    "longitude": -122.0
                }
            },
            "conflictLosersEtags": [],
            "created": {
                "timestamp": 1435514295943,
                "user": "_0ac573ae502ca7ca9d763a84b27bc42a",
                "device": "_2"
            },
            "modified": {
                "timestamp": 1435514295943,
                "user": "_0ac573ae502ca7ca9d763a84b27bc42a",
                "device": "_2"
            }
        },
        ...
    

    As for the record counts, yes mine are inaccurate too.

提交回复
热议问题