diff --git a/lib/src/client.dart b/lib/src/client.dart index dff72e3a..b1d55bfd 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -1576,9 +1576,6 @@ class Client extends MatrixApi { final success = await database.importDump(export); if (success) { - // closing including DB - await dispose(); - try { bearerToken = null; diff --git a/test/client_test.dart b/test/client_test.dart index 015c73f0..1f5f80ea 100644 --- a/test/client_test.dart +++ b/test/client_test.dart @@ -63,6 +63,19 @@ void main() { }); }); + group('Export and Import', () { + test('exportDump and importDump', () async { + final client = await getClient(); + final userId = client.userID; + final export = await client.exportDump(); + expect(export != null, true); + expect(client.userID, null); + final importClient = Client('Import', database: await getDatabase()); + await importClient.importDump(export!); + expect(importClient.userID, userId); + }); + }); + /// All Tests related to the Login group('client mem', tags: 'olm', () { late Client matrix;