No more sort option

We always just sort by stream_ordering
This commit is contained in:
Eric Eastwood 2024-06-13 15:47:33 -05:00
parent 35808b38db
commit a917edad8c
3 changed files with 1 additions and 13 deletions

View file

@ -216,7 +216,6 @@ class SlidingSyncHandler:
sync_config.user, sync_room_map, list_config.filters, to_token sync_config.user, sync_room_map, list_config.filters, to_token
) )
# TODO: Apply sorts
sorted_room_info = await self.sort_rooms( sorted_room_info = await self.sort_rooms(
filtered_sync_room_map, to_token filtered_sync_room_map, to_token
) )

View file

@ -176,7 +176,7 @@ class SlidingSyncBody(RequestBodyModel):
is used and all rooms are returned in this list. Integers are is used and all rooms are returned in this list. Integers are
*inclusive*. *inclusive*.
slow_get_all_rooms: Just get all rooms (for clients that don't want to deal with slow_get_all_rooms: Just get all rooms (for clients that don't want to deal with
sliding windows). When true, the `ranges` and `sort` fields are ignored. sliding windows). When true, the `ranges` field is ignored.
required_state: Required state for each room returned. An array of event required_state: Required state for each room returned. An array of event
type and state key tuples. Elements in this array are ORd together to type and state key tuples. Elements in this array are ORd together to
produce the final set of state events to return. produce the final set of state events to return.
@ -215,12 +215,6 @@ class SlidingSyncBody(RequestBodyModel):
`user_id` and optionally `avatar_url` and `displayname`) for the users used `user_id` and optionally `avatar_url` and `displayname`) for the users used
to calculate the room name. to calculate the room name.
filters: Filters to apply to the list before sorting. filters: Filters to apply to the list before sorting.
bump_event_types: Allowlist of event types which should be considered recent activity
when sorting `by_recency`. By omitting event types from this field,
clients can ensure that uninteresting events (e.g. a profile rename) do
not cause a room to jump to the top of its list(s). Empty or omitted
`bump_event_types` have no effectall events in a room will be
considered recent activity.
""" """
class Filters(RequestBodyModel): class Filters(RequestBodyModel):
@ -289,7 +283,6 @@ class SlidingSyncBody(RequestBodyModel):
slow_get_all_rooms: Optional[StrictBool] = False slow_get_all_rooms: Optional[StrictBool] = False
include_heroes: Optional[StrictBool] = False include_heroes: Optional[StrictBool] = False
filters: Optional[Filters] = None filters: Optional[Filters] = None
bump_event_types: Optional[List[StrictStr]] = None
class RoomSubscription(CommonRoomParameters): class RoomSubscription(CommonRoomParameters):
pass pass

View file

@ -1299,7 +1299,6 @@ class SlidingSyncTestCase(unittest.HomeserverTestCase):
"lists": { "lists": {
"foo-list": { "foo-list": {
"ranges": [[0, 99]], "ranges": [[0, 99]],
"sort": ["by_notification_level", "by_recency", "by_name"],
"required_state": [ "required_state": [
["m.room.join_rules", ""], ["m.room.join_rules", ""],
["m.room.history_visibility", ""], ["m.room.history_visibility", ""],
@ -1361,7 +1360,6 @@ class SlidingSyncTestCase(unittest.HomeserverTestCase):
"lists": { "lists": {
"foo-list": { "foo-list": {
"ranges": [[0, 99]], "ranges": [[0, 99]],
"sort": ["by_notification_level", "by_recency", "by_name"],
"required_state": [ "required_state": [
["m.room.join_rules", ""], ["m.room.join_rules", ""],
["m.room.history_visibility", ""], ["m.room.history_visibility", ""],
@ -1415,14 +1413,12 @@ class SlidingSyncTestCase(unittest.HomeserverTestCase):
"lists": { "lists": {
"dms": { "dms": {
"ranges": [[0, 99]], "ranges": [[0, 99]],
"sort": ["by_recency"],
"required_state": [], "required_state": [],
"timeline_limit": 1, "timeline_limit": 1,
"filters": {"is_dm": True}, "filters": {"is_dm": True},
}, },
"foo-list": { "foo-list": {
"ranges": [[0, 99]], "ranges": [[0, 99]],
"sort": ["by_recency"],
"required_state": [], "required_state": [],
"timeline_limit": 1, "timeline_limit": 1,
"filters": {"is_dm": False}, "filters": {"is_dm": False},