chore: Follow up database broken handling

This commit is contained in:
Krille 2024-03-29 12:28:47 +01:00
parent eb9cf18d30
commit 8a9715cac2
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -23,15 +23,8 @@ Future<DatabaseApi> flutterMatrixSdkDatabaseBuilder(Client client) async {
database = await _constructDatabase(client);
await database.open();
return database;
} catch (e) {
// Try to delete database so that it can created again on next init:
database?.delete().catchError(
(e, s) => Logs().w(
'Unable to delete database, after failed construction',
e,
s,
),
);
} catch (e, s) {
Logs().wtf('Unable to build database!', e, s);
// Send error notification:
final l10n = lookupL10n(PlatformDispatcher.instance.locale);
@ -101,6 +94,8 @@ Future<MatrixSdkDatabase> _constructDatabase(Client client) async {
Logs().w('Unable to init database encryption', e, s);
}
print('$path/${client.clientName}');
return MatrixSdkDatabase(
client.clientName,
database: await openDatabase(