How can I fix autosaveAllModels when running my database in background thread (iOS)?

Hi!

I'm running CBLDatabase in a dispatch queue of my own - following the concurrency guidelines (iOS app). However, when the app is minimized, autosaveAllModels: is getting called on the main thread. This causes a crash because the database is being used on the wrong thread. How can I make sure that autosaveAllModels runs, but on my queue?

Thanks!

// Mio

1 Answer

« Back to question.

That's a bug in Couchbase Lite, but no one's noticed it before, so thanks for pointing it out. I've just filed a bug report:
https://github.com/couchbase/couchbase-lite-ios/issues/441
I'll see if I can post a workaround there.