CouchbaseLiteSwift 2.0.0 Delete Database Failed: there are still open connections

I tried to delete my couch database on the device with try Database.delete(dbName), but pretty often it failed with "Couchbase: failed to delete database [dbname] Error Domain=LiteCore Code=24 “Still 2 open connection(s) to path[/dbName]/db.sqlite3”

I stopped the replicator, removed change listener on both replicator and database before the delete, so I don’t know why there are still open connections.

It may take a moment for the replicator’s connection to close, since it’s running on a background thread. (What platform is this on?) Try pausing a second after stopping the replicator and see if that helps.

You’re right! I waited for a second and it looks like the delete works. Thanks!

Actually the problem is still there. I extended the wait to 2 seconds but it may still fail with “connections are still open” errors.

Well, that sucks. :frowning: I’ve filed an issue. Please comment there if you have any further info or find a workaround.

Thanks @jens. I added a comment that the delete may still fail even after waiting a couple of seconds.