mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 15:21:24 +01:00
SSS: don't block if there is new extension data
This commit is contained in:
parent
395d16ca22
commit
d497a19c2d
1 changed files with 23 additions and 11 deletions
|
|
@ -499,9 +499,31 @@ pub(crate) async fn sync_events_v5_route(
|
|||
}
|
||||
}
|
||||
|
||||
let extensions = sync_events::v5::response::Extensions {
|
||||
to_device,
|
||||
e2ee: e2ee.unwrap_or_default(),
|
||||
account_data: account_data.unwrap_or_default(),
|
||||
receipts: sync_events::v5::response::Receipts {
|
||||
rooms: BTreeMap::new(),
|
||||
},
|
||||
typing: sync_events::v5::response::Typing {
|
||||
rooms: BTreeMap::new(),
|
||||
},
|
||||
};
|
||||
|
||||
let extensions_empty = extensions
|
||||
.to_device
|
||||
.as_ref()
|
||||
.is_none_or(|to_device| to_device.events.is_empty())
|
||||
&& extensions.e2ee.device_lists.is_empty()
|
||||
&& extensions.account_data.is_empty()
|
||||
&& extensions.receipts.is_empty()
|
||||
&& extensions.typing.is_empty();
|
||||
|
||||
if rooms
|
||||
.iter()
|
||||
.all(|(_, r)| r.timeline.is_empty() && r.required_state.is_empty())
|
||||
&& extensions_empty
|
||||
{
|
||||
// Hang a few seconds so requests are not spammed
|
||||
// Stop hanging if new info arrives
|
||||
|
|
@ -520,17 +542,7 @@ pub(crate) async fn sync_events_v5_route(
|
|||
pos: next_batch.to_string(),
|
||||
lists,
|
||||
rooms,
|
||||
extensions: sync_events::v5::response::Extensions {
|
||||
to_device,
|
||||
e2ee: e2ee.unwrap_or_default(),
|
||||
account_data: account_data.unwrap_or_default(),
|
||||
receipts: sync_events::v5::response::Receipts {
|
||||
rooms: BTreeMap::new(),
|
||||
},
|
||||
typing: sync_events::v5::response::Typing {
|
||||
rooms: BTreeMap::new(),
|
||||
},
|
||||
},
|
||||
extensions,
|
||||
}))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue