Closed ckrey closed 6 years ago
Interesting, thanks @ckrey. Would it be possible to add some tests around this?
Also, are maybe some other issues related to this?
Checks are difficult, because you see the results of persistence / non persistence only when you kill and restart the App in between...
I don't see any other open issue related to this. The CoreData persistence works exactly the same whether it is memory based or backed by SQLLite except is does not survive a kill app.
The persistence worked fine probably until 7 months ago when you solved a lot of concurrency problems by doing this: (this actually disabled the PERSISTENCE = YES setting)
Gotcha, but we could add test where we initialise MQTTSession
set persistence to YES
or NO
and assert that store type is NSSQLiteStoreType
or NSInMemoryStoreType
. This test would catch if someone tries to do something like I did in past?
I've added those tests here: https://github.com/novastone-media/MQTT-Client-Framework/pull/454
so I will merge this.
Thanks @ckrey!
The problem can be solved by lazy initialization of the NSPersistentStoreCoordinator