mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-01-01 07:23:49 +03:00
fix: incremental lazy loading
This commit is contained in:
parent
f285c89006
commit
c6d88359d7
1 changed files with 18 additions and 19 deletions
|
@ -484,28 +484,27 @@ async fn sync_helper(
|
||||||
|
|
||||||
state_events.push(pdu);
|
state_events.push(pdu);
|
||||||
}
|
}
|
||||||
for (_, event) in &timeline_pdus {
|
}
|
||||||
if lazy_loaded.contains(&event.sender) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if !db.rooms.lazy_load_was_sent_before(
|
for (_, event) in &timeline_pdus {
|
||||||
&sender_user,
|
if lazy_loaded.contains(&event.sender) {
|
||||||
&sender_device,
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if !db.rooms.lazy_load_was_sent_before(
|
||||||
|
&sender_user,
|
||||||
|
&sender_device,
|
||||||
|
&room_id,
|
||||||
|
&event.sender,
|
||||||
|
)? || lazy_load_send_redundant
|
||||||
|
{
|
||||||
|
if let Some(member_event) = db.rooms.room_state_get(
|
||||||
&room_id,
|
&room_id,
|
||||||
&event.sender,
|
&EventType::RoomMember,
|
||||||
)? || lazy_load_send_redundant
|
event.sender.as_str(),
|
||||||
{
|
)? {
|
||||||
let pdu = match db.rooms.get_pdu(&id)? {
|
|
||||||
Some(pdu) => pdu,
|
|
||||||
None => {
|
|
||||||
error!("Pdu in state not found: {}", id);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
lazy_loaded.insert(event.sender.clone());
|
lazy_loaded.insert(event.sender.clone());
|
||||||
state_events.push(pdu);
|
state_events.push(member_event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue