fix: incremental lazy loading

This commit is contained in:
Timo Kösters 2022-01-07 09:56:09 +01:00
parent f285c89006
commit c6d88359d7
No known key found for this signature in database
GPG key ID: 356E705610F626D5

View file

@ -484,6 +484,8 @@ async fn sync_helper(
state_events.push(pdu);
}
}
for (_, event) in &timeline_pdus {
if lazy_loaded.contains(&event.sender) {
continue;
@ -496,16 +498,13 @@ async fn sync_helper(
&event.sender,
)? || lazy_load_send_redundant
{
let pdu = match db.rooms.get_pdu(&id)? {
Some(pdu) => pdu,
None => {
error!("Pdu in state not found: {}", id);
continue;
}
};
if let Some(member_event) = db.rooms.room_state_get(
&room_id,
&EventType::RoomMember,
event.sender.as_str(),
)? {
lazy_loaded.insert(event.sender.clone());
state_events.push(pdu);
state_events.push(member_event);
}
}
}