From 560d9f73e732b1fbe4eef30b0780362cfddd6d51 Mon Sep 17 00:00:00 2001 From: Adam Van Ymeren Date: Thu, 13 Jul 2023 09:43:41 -0700 Subject: [PATCH] BE-13042: In inbox_state, set com.beeper.inbox.done before m.marked_unread (#76) In inbox_state, set com.beeper.inbox.done before m.marked_unread --- synapse/rest/client/account_data.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/synapse/rest/client/account_data.py b/synapse/rest/client/account_data.py index eaf5b23d8299..c01b08bcc153 100644 --- a/synapse/rest/client/account_data.py +++ b/synapse/rest/client/account_data.py @@ -360,13 +360,6 @@ async def on_PUT( body = parse_json_object_from_request(request) - if "marked_unread" in body: - marked_unread = {"unread": body["marked_unread"], "ts": ts} - await self.handler.add_account_data_to_room( - user_id, room_id, "m.marked_unread", marked_unread - ) - logger.info(f"SetBeeperMarkedUnread marked_unread={body['marked_unread']}") - if "done" in body: delta_ms = body["done"].get("at_delta") or 0 done = {"updated_ts": ts, "at_ts": ts + delta_ms} @@ -375,6 +368,13 @@ async def on_PUT( ) logger.info(f"SetBeeperDone done_delta_ms={delta_ms}") + if "marked_unread" in body: + marked_unread = {"unread": body["marked_unread"], "ts": ts} + await self.handler.add_account_data_to_room( + user_id, room_id, "m.marked_unread", marked_unread + ) + logger.info(f"SetBeeperMarkedUnread marked_unread={body['marked_unread']}") + if "read_markers" in body: await self.read_marker_client.handle_read_marker( room_id, body["read_markers"], requester