mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-06-04 23:18:47 -04:00
Resync state after partial-state join (#12394)
We work through all the events with partial state, updating the state at each of them. Once it's done, we recalculate the state for the whole room, and then mark the room as having complete state.
This commit is contained in:
parent
86cf6a3a17
commit
320186319a
8 changed files with 289 additions and 0 deletions
|
@ -963,6 +963,21 @@ class PersistEventsStore:
|
|||
values=to_insert,
|
||||
)
|
||||
|
||||
async def update_current_state(
|
||||
self,
|
||||
room_id: str,
|
||||
state_delta: DeltaState,
|
||||
stream_id: int,
|
||||
) -> None:
|
||||
"""Update the current state stored in the datatabase for the given room"""
|
||||
|
||||
await self.db_pool.runInteraction(
|
||||
"update_current_state",
|
||||
self._update_current_state_txn,
|
||||
state_delta_by_room={room_id: state_delta},
|
||||
stream_id=stream_id,
|
||||
)
|
||||
|
||||
def _update_current_state_txn(
|
||||
self,
|
||||
txn: LoggingTransaction,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue