Compare commits

...

2 Commits

Author SHA1 Message Date
Erik Johnston
7b457389ee Newsfile 2024-06-26 10:46:57 +01:00
Erik Johnston
d44ee3473e Handle multiple rows device inbox 2024-06-26 10:44:06 +01:00
2 changed files with 3 additions and 3 deletions

1
changelog.d/17362.bugfix Normal file
View File

@@ -0,0 +1 @@
Fix rare race which causes no new to-device messages to be received from remote server.

View File

@@ -825,14 +825,13 @@ class DeviceInboxWorkerStore(SQLBaseStore):
# Check if we've already inserted a matching message_id for that # Check if we've already inserted a matching message_id for that
# origin. This can happen if the origin doesn't receive our # origin. This can happen if the origin doesn't receive our
# acknowledgement from the first time we received the message. # acknowledgement from the first time we received the message.
already_inserted = self.db_pool.simple_select_one_txn( already_inserted = self.db_pool.simple_select_list_txn(
txn, txn,
table="device_federation_inbox", table="device_federation_inbox",
keyvalues={"origin": origin, "message_id": message_id}, keyvalues={"origin": origin, "message_id": message_id},
retcols=("message_id",), retcols=("message_id",),
allow_none=True,
) )
if already_inserted is not None: if already_inserted:
return return
# Add an entry for this message_id so that we know we've processed # Add an entry for this message_id so that we know we've processed