Merge branch 'td/fixCasting' into 'main'
fix: casting of a List<dynamic> to List<String> in getEventList and getEventIdList See merge request famedly/company/frontend/famedlysdk!1278
This commit is contained in:
commit
65828e11d9
|
|
@ -386,8 +386,8 @@ class HiveCollectionsDatabase extends DatabaseApi {
|
|||
runBenchmarked<List<Event>>('Get event list', () async {
|
||||
// Get the synced event IDs from the store
|
||||
final timelineKey = TupleKey(room.id, '').toString();
|
||||
final timelineEventIds =
|
||||
(await _timelineFragmentsBox.get(timelineKey) ?? []);
|
||||
final timelineEventIds = List<String>.from(
|
||||
(await _timelineFragmentsBox.get(timelineKey)) ?? []);
|
||||
|
||||
// Get the local stored SENDING events from the store
|
||||
late final List<String> sendingEventIds;
|
||||
|
|
@ -395,10 +395,8 @@ class HiveCollectionsDatabase extends DatabaseApi {
|
|||
sendingEventIds = [];
|
||||
} else {
|
||||
final sendingTimelineKey = TupleKey(room.id, 'SENDING').toString();
|
||||
sendingEventIds =
|
||||
(await _timelineFragmentsBox.get(sendingTimelineKey) ?? [])
|
||||
.whereType<String>()
|
||||
.toList();
|
||||
sendingEventIds = List<String>.from(
|
||||
(await _timelineFragmentsBox.get(sendingTimelineKey)) ?? []);
|
||||
}
|
||||
|
||||
// Combine those two lists while respecting the start and limit parameters.
|
||||
|
|
@ -425,9 +423,8 @@ class HiveCollectionsDatabase extends DatabaseApi {
|
|||
runBenchmarked<List<String>>('Get event id list', () async {
|
||||
// Get the synced event IDs from the store
|
||||
final timelineKey = TupleKey(room.id, '').toString();
|
||||
final timelineEventIds =
|
||||
(await _timelineFragmentsBox.get(timelineKey) as List<String>? ??
|
||||
[]);
|
||||
final timelineEventIds = List<String>.from(
|
||||
(await _timelineFragmentsBox.get(timelineKey)) ?? []);
|
||||
|
||||
// Get the local stored SENDING events from the store
|
||||
late final List<String> sendingEventIds;
|
||||
|
|
@ -435,9 +432,8 @@ class HiveCollectionsDatabase extends DatabaseApi {
|
|||
sendingEventIds = [];
|
||||
} else {
|
||||
final sendingTimelineKey = TupleKey(room.id, 'SENDING').toString();
|
||||
sendingEventIds = (await _timelineFragmentsBox.get(sendingTimelineKey)
|
||||
as List<String>? ??
|
||||
[]);
|
||||
sendingEventIds = List<String>.from(
|
||||
(await _timelineFragmentsBox.get(sendingTimelineKey)) ?? []);
|
||||
}
|
||||
|
||||
// Combine those two lists while respecting the start and limit parameters.
|
||||
|
|
|
|||
|
|
@ -393,18 +393,16 @@ class FamedlySdkHiveDatabase extends DatabaseApi {
|
|||
runBenchmarked<List<Event>>('Get event list', () async {
|
||||
// Get the synced event IDs from the store
|
||||
final timelineKey = MultiKey(room.id, '').toString();
|
||||
final timelineEventIds =
|
||||
(await _timelineFragmentsBox.get(timelineKey) as List? ?? []);
|
||||
|
||||
final timelineEventIds = List<String>.from(
|
||||
(await _timelineFragmentsBox.get(timelineKey)) ?? []);
|
||||
// Get the local stored SENDING events from the store
|
||||
late final List sendingEventIds;
|
||||
if (start != 0) {
|
||||
sendingEventIds = [];
|
||||
} else {
|
||||
final sendingTimelineKey = MultiKey(room.id, 'SENDING').toString();
|
||||
sendingEventIds =
|
||||
(await _timelineFragmentsBox.get(sendingTimelineKey) as List? ??
|
||||
[]);
|
||||
sendingEventIds = List<String>.from(
|
||||
(await _timelineFragmentsBox.get(sendingTimelineKey)) ?? []);
|
||||
}
|
||||
|
||||
// Combine those two lists while respecting the start and limit parameters.
|
||||
|
|
@ -428,9 +426,9 @@ class FamedlySdkHiveDatabase extends DatabaseApi {
|
|||
runBenchmarked<List<String>>('Get event id list', () async {
|
||||
// Get the synced event IDs from the store
|
||||
final timelineKey = MultiKey(room.id, '').toString();
|
||||
final timelineEventIds =
|
||||
(await _timelineFragmentsBox.get(timelineKey) as List<String>? ??
|
||||
[]);
|
||||
|
||||
final timelineEventIds = List<String>.from(
|
||||
(await _timelineFragmentsBox.get(timelineKey)) ?? []);
|
||||
|
||||
// Get the local stored SENDING events from the store
|
||||
late final List<String> sendingEventIds;
|
||||
|
|
@ -438,9 +436,8 @@ class FamedlySdkHiveDatabase extends DatabaseApi {
|
|||
sendingEventIds = [];
|
||||
} else {
|
||||
final sendingTimelineKey = MultiKey(room.id, 'SENDING').toString();
|
||||
sendingEventIds = (await _timelineFragmentsBox.get(sendingTimelineKey)
|
||||
as List<String>? ??
|
||||
[]);
|
||||
sendingEventIds = List<String>.from(
|
||||
(await _timelineFragmentsBox.get(sendingTimelineKey)) ?? []);
|
||||
}
|
||||
|
||||
// Combine those two lists while respecting the start and limit parameters.
|
||||
|
|
|
|||
Loading…
Reference in New Issue