mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-24 14:32:37 +01:00
chore: Update SDK and remove boxes on corruption
This commit is contained in:
parent
88d3f5e013
commit
7ad14465d2
@ -12,6 +12,9 @@ import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
import '../client_manager.dart';
|
||||
import '../famedlysdk_store.dart';
|
||||
|
||||
class FlutterFluffyBoxDatabase extends FluffyBoxDatabase {
|
||||
FlutterFluffyBoxDatabase(
|
||||
String name,
|
||||
@ -60,7 +63,15 @@ class FlutterFluffyBoxDatabase extends FluffyBoxDatabase {
|
||||
await _findDatabasePath(client),
|
||||
key: hiverCipher,
|
||||
);
|
||||
await db.open();
|
||||
try {
|
||||
await db.open();
|
||||
} catch (_) {
|
||||
Logs().w('Unable to open FluffyBox. Delete database and storage key...');
|
||||
await Store().deleteItem(ClientManager.clientNamespace);
|
||||
const FlutterSecureStorage().delete(key: _cipherStorageKey);
|
||||
await db.clear();
|
||||
rethrow;
|
||||
}
|
||||
Logs().d('FluffyBox is ready');
|
||||
return db;
|
||||
}
|
||||
|
@ -364,7 +364,7 @@ packages:
|
||||
name: fluffybox
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.6"
|
||||
version: "0.3.1"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@ -782,7 +782,7 @@ packages:
|
||||
description:
|
||||
path: "."
|
||||
ref: "krille/idb"
|
||||
resolved-ref: "74037fb8ae0f4c4e1ac946d7c2057bf6e2da7aaf"
|
||||
resolved-ref: e4d9ee12a84d804d3de190db6fe597eea72bd094
|
||||
url: "https://gitlab.com/famedly/company/frontend/famedlysdk.git"
|
||||
source: git
|
||||
version: "0.7.0-nullsafety.6"
|
||||
|
Loading…
Reference in New Issue
Block a user