From 966a886b36c4ac14ae578b3a849671ed6ed0bdce Mon Sep 17 00:00:00 2001 From: Nick Mills-Barrett Date: Fri, 8 Mar 2024 17:01:27 +0000 Subject: [PATCH] Include stream ordering in the unsigned event dict --- synapse/events/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/synapse/events/utils.py b/synapse/events/utils.py index 077247231..ccece1885 100644 --- a/synapse/events/utils.py +++ b/synapse/events/utils.py @@ -505,6 +505,11 @@ def serialize_event( ): d["unsigned"]["transaction_id"] = txn_id + # Beeper: include internal stream ordering as HS order unsigned hint + stream_ordering = getattr(e.internal_metadata, "stream_ordering", None) + if stream_ordering: + d["unsigned"]["com.beeper.hs.order"] = stream_ordering + # invite_room_state and knock_room_state are a list of stripped room state events # that are meant to provide metadata about a room to an invitee/knocker. They are # intended to only be included in specific circumstances, such as down sync, and