synapse icon indicating copy to clipboard operation
synapse copied to clipboard

Faster joins: non-`lazy_load_members` `/sync`s should not block

Open squahtx opened this issue 2 years ago • 4 comments

Instead they should pretend that the room has not been joined yet.

/syncs with lazy_load_members turned on should continue to return the room.

squahtx avatar Jun 08 '22 16:06 squahtx

One particular challenge here is being able to figure out which rooms have completed their state resyncs since a given /sync token.

richvdh avatar Jun 08 '22 17:06 richvdh

For the record (contrary to what I may have said earlier): this is a fair way down the order of things that I agreed with dan, so maybe not the best battlefront to open right now. Having non-lazy_load_members /syncs block while a faster join is in progress is fine for now.

richvdh avatar Jun 08 '22 17:06 richvdh

One particular challenge here is being able to figure out which rooms have completed their state resyncs since a given /sync token.

I guess the simplest thing is to add a table that stores the stream ordering of when a room completed joining? Then the sync code can check that table for new rooms.

Note that we already have features for excluding rooms from /sync, so we have prior art there.

erikjohnston avatar Aug 02 '22 08:08 erikjohnston

I guess the simplest thing is to add a table that stores the stream ordering of when a room completed joining? Then the sync code can check that table for new rooms.

I guess the question is more, which stream should we use? We could reuse the events stream, but that would add another complexity to an already complex stream. We could make a new one, but that would mean adding another field to the sync tokens.

erikjohnston avatar Aug 02 '22 08:08 erikjohnston

I guess the question is more, which stream should we use? We could reuse the events stream, but that would add another complexity to an already complex stream. We could make a new one, but that would mean adding another field to the sync tokens.

Yeah. I'm unenthusiastic about complexifying the events stream any further, even if that does mean adding yet another field to the sync tokens. (Sliding sync will mean that clients no longer need to worry about raw sync tokens, right??)

richvdh avatar Oct 10 '22 17:10 richvdh

Just a note of an edge case before I forget: if you see a room become un-partial-stated in a sync's window, it's important to still check that it isn't partial-stated at the end. The room could have been left and rejoined in the meantime since becoming originally un-partial-stated.

reivilibre avatar Nov 11 '22 18:11 reivilibre