-
Notifications
You must be signed in to change notification settings - Fork 0
Description
With a growing number of events it gets more expensive to calculate the most recent state since we need to consider all events in the timeline.
Snapshots of the most recent state would be helpful since a "late comer" needs to read the latest snapshot and all subsequent events only.
Creating snapshots is triggered by the number of events that have been posted since the latest snapshot. The responsibility for creating the snapshot for a room/layer is transferred to the client whose latest events releases the trigger.
If there are two users A and B both clients need to count the events. If the trigger count is set to 10 and A posted 9 events the client that posts the next event is responsible for the snapshot.
Snapshots may become big and exceed the max size of matrix messages. Thus snapshots need to be sliced into chunks.