Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sliding sync for rooms with unknown room version #17733

Merged
merged 3 commits into from
Sep 19, 2024

Conversation

erikjohnston
Copy link
Member

@erikjohnston erikjohnston commented Sep 19, 2024

Follow on from #17727

Example stack trace:

        Traceback (most recent call last):
          File "/synapse/synapse/http/server.py", line 332, in _async_render_wrapper
            callback_return = await self._async_render(request)
          File "/synapse/synapse/http/server.py", line 544, in _async_render
            callback_return = await raw_callback_return
          File "/synapse/synapse/rest/client/sync.py", line 940, in on_POST
            sliding_sync_results = await self.sliding_sync_handler.wait_for_sync_for_user(
          File "/synapse/synapse/handlers/sliding_sync/__init__.py", line 151, in wait_for_sync_for_user
            result = await self.current_sync_for_user(
          File "/synapse/synapse/logging/opentracing.py", line 922, in _wrapper
            return await func(*args, **kwargs)
          File "/synapse/synapse/handlers/sliding_sync/__init__.py", line 228, in current_sync_for_user
            interested_rooms = await self.room_lists.compute_interested_rooms(
          File "/synapse/synapse/handlers/sliding_sync/room_lists.py", line 186, in compute_interested_rooms
            return await self._compute_interested_rooms_new_tables(
          File "/synapse/synapse/logging/opentracing.py", line 922, in _wrapper
            return await func(*args, **kwargs)
          File "/synapse/synapse/handlers/sliding_sync/room_lists.py", line 383, in _compute_interested_rooms_new_tables
            sorted_room_info = await self.sort_rooms(
          File "/synapse/synapse/logging/opentracing.py", line 922, in _wrapper
            return await func(*args, **kwargs)
          File "/synapse/synapse/handlers/sliding_sync/room_lists.py", line 1922, in sort_rooms
            return sorted(
          File "/synapse/synapse/handlers/sliding_sync/room_lists.py", line 1925, in <lambda>
            key=lambda room_info: last_activity_in_room_map[room_info.room_id],
        KeyError: '!bkCPfqjchccmVTmolv:test'

In particular, this caused issues sorting the room as we assume we can
get a latest stream ordering for all rooms, but we can't for rooms with
unknown room version.
@erikjohnston
Copy link
Member Author

cc @kegsay

Copy link
Contributor

@kegsay kegsay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems plausible.

@erikjohnston erikjohnston merged commit 07a51d2 into develop Sep 19, 2024
39 checks passed
@erikjohnston erikjohnston deleted the erikj/ss_filter_unknown_room_versions branch September 19, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants