You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Realm documentation says that it is possible to add a flag .all to realm.add(), so that he would not crash but overwrite existing data.
What do you think about adding an update .all flag to realm.add() or raise an exception for handling it on the app side?
Thanks!
Here are the logs:
“CloudKitSynchronizer >> Initiating synchronization”
“QSCloudKitSynchronizer >> Downloaded 1 changed records >> from zone <CKRecordZoneID: 0x281357720; ownerName=__defaultOwner__, zoneName=QSCloudKitCustomZoneName>”
“QSCloudKitSynchronizer >> Downloaded 0 deleted record IDs >> from zone <CKRecordZoneID: 0x281357720; ownerName=__defaultOwner__, zoneName=QSCloudKitCustomZoneName>”
2021-03-05 13:38:45.877080+0200 DrinkWater[3753:1095927] *** Terminating app due to uncaught exception ‘RLMException’, reason: ’Attempting to create an object of type ‘DrinkEvent’ with an existing primary key value ‘636637079.097727’.'
*** First throw call stack:
(0x18636bae4 0x19a1c2cb4 0x10328b038 0x103348684 0x105162174 0x105552214 0x10555bd2c 0x105547388 0x105530ca8 0x105530d00 0x10581d5f4 0x10582c978 0x10581d5f4 0x10582ba64 0x1862eb708 0x1862e5bb0 0x1862e4cc8 0x19cad0598 0x188bbb488 0x188bc0a08 0x1008e8150 0x185fc4588)
libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception ‘RLMException’, reason: ’Attempting to create an object of type ‘DrinkEvent’ with an existing primary key value ‘636637079.097727’.'
terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception ‘RLMException’, reason: ’Attempting to create an object of type ‘DrinkEvent’ with an existing primary key value ‘636637079.097727’.'
terminating with uncaught exception of type NSException
The text was updated successfully, but these errors were encountered:
Can you reproduce the issue with the SyncKit example project?
I haven't tried it because my case isn't usual.
Can you provide code and steps needed to reproduce?
I reproduce this crash during synchronization data from the Apple Watch by both channels simultaneously: by iCloud and Bluetooth.
During data synchronization with iCloud (via SyncKit), the same data piece (with the same personal key) received from the Watch via Bluetooth. It leads to the crash.
I'm afraid that I would need to be able to reproduce the issue in order to come up with a solution.
There is already a test to explicitly check that it's ok to create an object with the same identifier on two devices, so the crash is happening due to something more specific.
I'm happy to have a look if you can upload a project to Github, ideally with the bare minimum code that reproduces the crash.
FWIW I've just reproduced this issue. I'll update on any findings
Ok, in my case it happens because I have a second process unrelated to syncing which also creates records locally that may already exist in iCloud. So SyncedEntity doesn't exist, gets created, and then fails when it tries to create the realm object with the data because it already exists. I've added merging logic to my fork.
Hello,
It seems like Realm crashes the SyncKit.
Realm documentation says that it is possible to add a flag
.all
torealm.add()
, so that he would not crash but overwrite existing data.What do you think about adding an update
.all
flag torealm.add()
or raise an exception for handling it on the app side?Thanks!
Here are the logs:
The text was updated successfully, but these errors were encountered: