fluffychat merge
This commit is contained in:
commit
13890d5082
1 changed files with 19 additions and 20 deletions
|
|
@ -32,6 +32,20 @@ Future<DatabaseApi> flutterMatrixSdkDatabaseBuilder(String clientName) async {
|
|||
);
|
||||
// Pangea#
|
||||
Logs().wtf('Unable to construct database!', e, s);
|
||||
|
||||
try {
|
||||
// #Pangea
|
||||
// // Send error notification:
|
||||
// final l10n = await lookupL10n(PlatformDispatcher.instance.locale);
|
||||
// ClientManager.sendInitNotification(
|
||||
// l10n.initAppError,
|
||||
// e.toString(),
|
||||
// );
|
||||
// Pangea#
|
||||
} catch (e, s) {
|
||||
Logs().e('Unable to send error notification', e, s);
|
||||
}
|
||||
|
||||
// Try to delete database so that it can created again on next init:
|
||||
database?.delete().catchError(
|
||||
// #Pangea
|
||||
|
|
@ -52,27 +66,11 @@ Future<DatabaseApi> flutterMatrixSdkDatabaseBuilder(String clientName) async {
|
|||
);
|
||||
|
||||
// Delete database file:
|
||||
if (database == null && !kIsWeb) {
|
||||
if (!kIsWeb) {
|
||||
final dbFile = File(await _getDatabasePath(clientName));
|
||||
if (await dbFile.exists()) await dbFile.delete();
|
||||
}
|
||||
|
||||
try {
|
||||
// Send error notification:
|
||||
// #Pangea
|
||||
// final l10n = await lookupL10n(PlatformDispatcher.instance.locale);
|
||||
// ClientManager.sendInitNotification(
|
||||
// l10n.initAppError,
|
||||
// l10n.databaseBuildErrorBody(
|
||||
// AppConfig.newIssueUrl.toString(),
|
||||
// e.toString(),
|
||||
// ),
|
||||
// );
|
||||
// Pangea#
|
||||
} catch (e, s) {
|
||||
Logs().e('Unable to send error notification', e, s);
|
||||
}
|
||||
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
|
@ -104,16 +102,17 @@ Future<MatrixSdkDatabase> _constructDatabase(String clientName) async {
|
|||
// import the SQLite / SQLCipher shared objects / dynamic libraries
|
||||
final factory =
|
||||
createDatabaseFactoryFfi(ffiInit: SQfLiteEncryptionHelper.ffiInit);
|
||||
|
||||
// #Pangea
|
||||
Sentry.addBreadcrumb(Breadcrumb(message: 'Database path: $path'));
|
||||
// Pangea#
|
||||
|
||||
// migrate from potential previous SQLite database path to current one
|
||||
await _migrateLegacyLocation(path, clientName);
|
||||
|
||||
// required for [getDatabasesPath]
|
||||
databaseFactory = factory;
|
||||
|
||||
// migrate from potential previous SQLite database path to current one
|
||||
await _migrateLegacyLocation(path, clientName);
|
||||
|
||||
// in case we got a cipher, we use the encryption helper
|
||||
// to manage SQLite encryption
|
||||
final helper = cipher == null
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue