fix: storing the end of history pagination
At least in our CI this throws a null assertion error and since we explicitly expect this to sometimes be null in our code, we should store it as such.
This commit is contained in:
parent
bbb157503d
commit
500e423c00
|
|
@ -233,7 +233,7 @@ abstract class DatabaseApi {
|
|||
Future removeEvent(String eventId, String roomId);
|
||||
|
||||
Future setRoomPrevBatch(
|
||||
String prevBatch,
|
||||
String? prevBatch,
|
||||
String roomId,
|
||||
Client client,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -944,7 +944,7 @@ class HiveCollectionsDatabase extends DatabaseApi {
|
|||
|
||||
@override
|
||||
Future<void> 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);
|
||||
|
|
|
|||
|
|
@ -885,7 +885,7 @@ class FamedlySdkHiveDatabase extends DatabaseApi {
|
|||
|
||||
@override
|
||||
Future<void> 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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue