diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2024-04-29 14:11:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-29 14:11:00 +0100 |
commit | c897ac63e90e198723baa4bc73574a30fb02176b (patch) | |
tree | 58b0543e97711d28084468c0b11c6f266d1d2bb6 /synapse/handlers | |
parent | Declare support for Matrix v1.10. (#17082) (diff) | |
download | synapse-c897ac63e90e198723baa4bc73574a30fb02176b.tar.xz |
Ensure that incoming to-device messages are not dropped (#17127)
... when workers are unreachable, etc. Fixes https://github.com/element-hq/synapse/issues/17117. The general principle is just to make sure that we propagate any exceptions to the JsonResource, so that we return an error code to the sending server. That means that the sending server no longer considers the message safely sent, so it will retry later. In the issue, Erik mentions that an alternative solution would be to persist the to-device messages into a table so that they can be retried. This might be an improvement for performance, but even if we did that, we still need this mechanism, since we might be unable to reach the database. So, if we want to do that, it can be a later follow-up. --------- Co-authored-by: Erik Johnston <erik@matrix.org>
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/devicemessage.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/handlers/devicemessage.py b/synapse/handlers/devicemessage.py index 2b034dcbb7..79be7c97c8 100644 --- a/synapse/handlers/devicemessage.py +++ b/synapse/handlers/devicemessage.py @@ -104,6 +104,9 @@ class DeviceMessageHandler: """ Handle receiving to-device messages from remote homeservers. + Note that any errors thrown from this method will cause the federation /send + request to receive an error response. + Args: origin: The remote homeserver. content: The JSON dictionary containing the to-device messages. |