Open viktorstrate opened 3 years ago
Hi @viktorstrate, sorry for not following up earlier. I tried building your app and wasn't able to do so.
From the logs I believe some of the JSON is sending an empty createdAt date or a createdAt format that it's not parsable and it's crashing because it has been marked as a required attribute.
If you mark it as optional or make sure a proper date is always provided then it should be better
I have difficult bug, for one of my open-source side projects Time-Agent, that I've been trying to fix on and off for the last half a year or so.
The app somtimes crashes when I sync CoreData with a json file using this library. The biggest mystery is that it only happends when a debugger isn't attached, so I can only debug it through the mac Console application. (Could it possibly be a race condition problem?)
To crash the app, I have to:
This could very well be a programming error on my side, but I am opening this issue because the crash report states that it is this library that causes the crash:
Sync/Source/Sync/NSManagedObject+Sync.swift, line 60
.From the crash logs, it looks like all date columns are
nil
, that iscreatedAt
andupdatedAt
, and that it crashes because these fields are required. I don't understand why these values would benil
, they are not nil in the .json file, because they are logged afterProjects to sync
with the proper dates. And I would imagine that CoreData wouldn't let me save invalid entities in the first place. So I'm left to believe that it could have something to do with the internals of this library?Any help is much appreciated 😊
Function that causes the crash:
Console output of the
load()
function above:Detailed crash report:
Edit: It's also tested with the newest version of Sync v6.0.3, with the exact same output