From 208c28791e00c20dccd3d2788a74de04bebb261b Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 5 Jan 2024 13:01:15 +0000 Subject: [PATCH] Update synapse/handlers/room.py Co-authored-by: reivilibre --- synapse/handlers/room.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index 97239b1b491..41b00a5cf7b 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -1744,7 +1744,7 @@ async def get_new_events( # We know stream_ordering must be not None here, as its been # persisted, but mypy doesn't know that - events.sort(key=lambda e: e.internal_metadata.stream_ordering or 0) + events.sort(key=lambda e: cast(int, e.internal_metadata.stream_ordering)) if limit: events[:] = events[:limit]