> The error message refers to opening the database, but your email implies
> the database is already open. Do you know which API call this error is
> returned from? And is anything being logged before this error?
>
> This isn’t the error I’d expect when the filesystem is locked. In 1.4 and
> 1.4.1, Pasin and I added code to detect those filesystem/SQLite errors and
> return appropriate CBL errors (I think it’s 401.)
>
This error happened before the application was launched. It was launched
via the sendMessage call on the Apple Watch app.
So the error was from the following code:
NSError *error = nil;
CBLDatabaseOptions *options = [[CBLDatabaseOptions alloc] init];
// options.storageType = kCBLForestDBStorage;
// options.storageType = kCBLSQLiteStorage;
options.encryptionKey = self.encryptionKey;
options.create = YES;
BOOL databaseExists = [self.couchManager databaseExistsNamed:dbName];
self.couchDatabase = [self.couchManager openDatabaseNamed:dbName
withOptions:options
error:&error];
if (error && error.code == 401) {
// database file is encrypted. Ask for a key.
self.isDatabaseEncrypted = YES;
self.documentIsLocked = YES;
} else if (error || !self.couchDatabase) {
NSLog(@"Error opening Tap Forms database: %@", error);
So it's that last NSLog that's being triggered to display that 400 error
message.
BUT, when I have the app opened and access the data from the watch,
everything works ok. About 20 or so seconds after the phone is locked, even
if the app was running, I start getting no data back from the app. So it
seems after a little while the database can no longer be accessed.
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/db7b0d76-bb5e-413a-a08b-a96f26f1d8c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.