Error re-creating DB after password change; started happening with upgrade
We recently had to upgrade Couchbase Lite from 2.x to 3.2 due to Apple rejecting builds due to something our DevOps called bytecode.
Starting with this upgrade, our password change code has stopped working on iOS.
We’re using *.swift files but they’re using an @objc annotation, so I’m not certain which language s actually used.
I think this is a requirement for these functions to be exposed to react-native, which we use.
This code calls
Database.delete(withName: dbName)
and I tried to change to:
Database.delete(withName: dbName, inDirectory: directory)
I tried to use database.delete()
too, but I couldn’t instantiate the database without the previous password.
None of these throw any error and the execution goes on as if they worked.
But then when we get to the following line, which should re-create the DB:
let database = try Database(name: dbName, config: config)
…we’re getting this error instead:
file is not a database (or encryption key is invalid/missing)
This has us suspecting that the database hasn’t actually been deleted and that the error comes because the code is trying to decrypt the old DB with the new password.
What could we try to fix this issue?
Note that we did try to use changeEncryptionKey before we settled for this approach, but we were not able to get it working properly. I wasn’t the one who worked on this so I don’t have more details.
Versions:
- Server: 7.6.5
- Sync: 3.2.4
- Lite: 3.2
5 posts - 2 participants