Skip to content

Rework sliding_sync backend; add SpaceService task to sync spaces#623

Merged
kevinaboos merged 3 commits intoproject-robius:mainfrom
kevinaboos:sliding_sync_spaces_rework
Nov 5, 2025
Merged

Rework sliding_sync backend; add SpaceService task to sync spaces#623
kevinaboos merged 3 commits intoproject-robius:mainfrom
kevinaboos:sliding_sync_spaces_rework

Conversation

@kevinaboos
Copy link
Member

@kevinaboos kevinaboos commented Nov 4, 2025

Add an initial async task that uses the SpaceService to sync changes to joined spaces.

Set default room list filter to something more expected:

  • exclude Left rooms
  • exclude spaces, since we sync those separately now
  • exclude "non-active" rooms, e.g., those that have been tombstoned and whose successor room we have already joined.

Stop using the notion of all_known_loaded_rooms, because when filters are applied to the room list service (and even when they aren't), we will likely never actually receive the max number of rooms that the homeserver knows about our user account.

Unfortunately, as far as I can tell, there is no definitive way to know if our client's RoomListService has received all of the expected rooms from the homeserver, given the currently-active filter. The existing state subscribers don't accurately represent whether we have received all expected rooms from the homeserver.

So for now, we simply do not attempt to determine that, and allow all restored rooms to endlessly spin while waiting for that room to be received from the homeserver.
Perhaps in the future we can re-create the notion of all expected rooms being fully loaded, but not for now.
Maybe we can just call get_room_preview for a room if it hasn't been loaded after a certain timeout, e.g., 30-60 seconds. But that's not ideal, and it seems like the SDK definitely should have a way to determine this.

Set default room list filter to something more expected:
* exclude Left rooms
* exclude spaces, since we sync those separately now
* exclude "non-active" rooms, e.g., those that have been tombstoned
  and whose successor room we have already joined.

Stop using the notion of `all_known_loaded_rooms`, because when filters
are applied to the room list service (and even when they aren't), we will
likely never actually receive the max number of rooms that
the homeserver knows about our user account.

Unfortunately, as far as I can tell, there is no definitive way to know
if our client's RoomListService has received all of the expected rooms
from the homeserver, given the currently-active filter.
The existing state subscribers don't accurately represent whether
we have received all *expected* rooms from the homeserver.

So for now, we simply do not attempt to determine that,
and allow all restored rooms to endlessly spin while waiting for that room
to be received from the homeserver.
Perhaps in the future we can re-create the notion of all expected rooms
being fully loaded, but not for now.
Maybe we can just call get_room_preview for a room if it hasn't been loaded
after a certain timeout, e.g., 30-60 seconds. But that's not ideal,
and it seems like the SDK definitely should have a way to determine this.
Now the "top-level" `start_matrix_client_login_and_sync()` function
is responsible for monitoring its three sub-tasks:
* The matrix worker task that handles incoming `MatrixRequest`s
* The task that handles updates from the room list service
* The task that handles updates from the space service (still in-progress)
@kevinaboos kevinaboos merged commit c2ea9a1 into project-robius:main Nov 5, 2025
11 checks passed
@kevinaboos kevinaboos deleted the sliding_sync_spaces_rework branch November 5, 2025 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant