diff --git a/lib/src/database/database_api.dart b/lib/src/database/database_api.dart index 02059ce3..589e7102 100644 --- a/lib/src/database/database_api.dart +++ b/lib/src/database/database_api.dart @@ -233,7 +233,7 @@ abstract class DatabaseApi { Future removeEvent(String eventId, String roomId); Future setRoomPrevBatch( - String prevBatch, + String? prevBatch, String roomId, Client client, ); diff --git a/lib/src/database/hive_collections_database.dart b/lib/src/database/hive_collections_database.dart index 94a896e4..117ce23f 100644 --- a/lib/src/database/hive_collections_database.dart +++ b/lib/src/database/hive_collections_database.dart @@ -944,7 +944,7 @@ class HiveCollectionsDatabase extends DatabaseApi { @override Future setRoomPrevBatch( - String prevBatch, String roomId, Client client) async { + String? prevBatch, String roomId, Client client) async { final raw = await _roomsBox.get(roomId); if (raw == null) return; final room = Room.fromJson(copyMap(raw), client); diff --git a/lib/src/database/hive_database.dart b/lib/src/database/hive_database.dart index 114b4232..f3bfa9c7 100644 --- a/lib/src/database/hive_database.dart +++ b/lib/src/database/hive_database.dart @@ -885,7 +885,7 @@ class FamedlySdkHiveDatabase extends DatabaseApi { @override Future setRoomPrevBatch( - String prevBatch, String roomId, Client client) async { + String? prevBatch, String roomId, Client client) async { final raw = await _roomsBox.get(roomId.toHiveKey); if (raw == null) return; final room = Room.fromJson(convertToJson(raw), client); diff --git a/lib/src/room.dart b/lib/src/room.dart index 2596fcea..f4b3e6e8 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -1281,7 +1281,7 @@ class Room { if (client.database != null) { await client.database?.transaction(() async { if (storeInDatabase) { - await client.database?.setRoomPrevBatch(resp.end!, id, client); + await client.database?.setRoomPrevBatch(resp.end, id, client); } await loadFn(); });