synapse-product/synapse
Brendan Abolivier 5705ecaec6
Don't 500 code when trying to exchange a revoked 3PID invite
While this is not documented in the spec (but should be), Riot (and other clients) revoke 3PID invites by sending a m.room.third_party_invite event with an empty ({}) content to the room's state.
When the invited 3PID gets associated with a MXID, the identity server (which doesn't know about revocations) sends down to the MXID's homeserver all of the undelivered invites it has for this 3PID. The homeserver then tries to talk to the inviting homeserver in order to exchange these invite for m.room.member events.
When one of the invite is revoked, the inviting homeserver responds with a 500 error because it tries to extract a 'display_name' property from the content, which is empty. This might cause the invited server to consider that the server is down and not try to exchange other, valid invites (or at least delay it).

This fix handles the case of revoked invites by avoiding trying to fetch a 'display_name' from the original invite's content, and letting the m.room.member event fail the auth rules (because, since the original invite's content is empty, it doesn't have public keys), which results in sending a 403 with the correct error message to the invited server.
2019-10-02 11:19:43 +01:00
..
_scripts Run Black. (#5482) 2019-06-20 19:32:02 +10:00
api Add device and appservice tags 2019-09-25 11:59:00 +01:00
app add report_stats_endpoint config option (#6012) 2019-09-12 11:24:57 +01:00
appservice Remove double return statements (#5962) 2019-09-03 11:42:45 +01:00
config Fix 'redaction_retention_period' sampel config to match guidelines 2019-09-26 16:43:52 +01:00
crypto Fix well-known lookups with the federation certificate whitelist (#5997) 2019-09-14 04:58:38 +10:00
events Merge pull request #5805 from matrix-org/erikj/validate_state 2019-08-01 13:45:48 +01:00
federation Fix exception when resetting retry timings 2019-09-20 12:09:39 +01:00
groups Replace returnValue with return (#5736) 2019-07-23 23:00:55 +10:00
handlers Don't 500 code when trying to exchange a revoked 3PID invite 2019-10-02 11:19:43 +01:00
http Edit SimpleHttpClient to reference that header keys can be passed as str or bytes (#6077) 2019-09-27 17:59:18 +01:00
logging Fix logcontext spam on non-Linux platforms (#6059) 2019-09-18 21:55:37 +01:00
metrics Update comments and docstring 2019-09-25 18:17:39 +01:00
module_api Remove unnecessary parentheses around return statements (#5931) 2019-08-30 16:28:26 +01:00
push Generalize email sending logging (#6075) 2019-09-23 14:38:19 +01:00
replication Trace how long it takes for the send trasaction to complete, including retrys (#5986) 2019-09-05 17:44:55 +01:00
res/templates Allow HS to send emails when adding an email to the HS (#6042) 2019-09-20 15:21:30 +01:00
rest Merge pull request #6108 from matrix-org/erikj/remove_get_user_by_req-span 2019-09-27 10:02:57 +01:00
server_notices Remove unnecessary parentheses around return statements (#5931) 2019-08-30 16:28:26 +01:00
state Remove double return statements (#5962) 2019-09-03 11:42:45 +01:00
static Fix SSO fallback login 2019-09-12 11:42:47 +01:00
storage Merge branch 'erikj/fixup_devices_last_seen_query' of github.com:matrix-org/synapse into develop 2019-10-01 10:17:24 +01:00
streams Remove unnecessary parentheses around return statements (#5931) 2019-08-30 16:28:26 +01:00
util Merge branch 'develop' into rav/fix_attribute_mapping 2019-09-19 20:32:25 +01:00
__init__.py bump version 2019-09-26 12:29:59 +01:00
event_auth.py Cleanup event auth type initialisation (#5975) 2019-09-04 16:16:56 +01:00
notifier.py Remove unnecessary parentheses around return statements (#5931) 2019-08-30 16:28:26 +01:00
python_dependencies.py Fix for structured logging tests stomping on logs (#6023) 2019-09-13 02:29:55 +10:00
secrets.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00
server.py Allow use of different ratelimits for admin redactions. 2019-09-11 10:46:38 +01:00
server.pyi Run Black. (#5482) 2019-06-20 19:32:02 +10:00
types.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00
visibility.py Replace returnValue with return (#5736) 2019-07-23 23:00:55 +10:00