mirror of
https://github.com/element-hq/synapse.git
synced 2026-03-29 08:50:09 +00:00
tests require deterministic ordering of priority rooms
This commit is contained in:
@@ -757,10 +757,11 @@ class ProfileHandler:
|
||||
)
|
||||
|
||||
# Sort rooms by activity (descending stream ordering)
|
||||
# Use room_id as tiebreaker for deterministic ordering
|
||||
# Higher activity first, then alphabetically by room_id for ties
|
||||
priority_room_ids = sorted(
|
||||
room_activity.keys(),
|
||||
key=lambda rid: room_activity.get(rid, 0),
|
||||
reverse=True,
|
||||
key=lambda rid: (-room_activity.get(rid, 0), rid),
|
||||
)[:NUMBER_OF_PRIORITISED_ROOMS]
|
||||
|
||||
# Store the priority list so we can resume if interrupted
|
||||
|
||||
Reference in New Issue
Block a user