forked-synapse/synapse/handlers
Kegan Dougal 259442fa4c
bugfix: make msc3967 idempotent (#16943)
MSC3967 was updated recently to make it more robust to network failures:

> there is an existing cross-signing master key and it exactly matches
the cross-signing master key provided in the request body. If there are
any additional keys provided in the request (self signing key, user
signing key) they MUST also match the existing keys stored on the
server. In other words, the request contains no new keys. If there are
new keys, UIA MUST be performed.


https://github.com/matrix-org/matrix-spec-proposals/blob/hughns/device-signing-upload-uia/proposals/3967-device-signing-upload-uia.md#proposal

This covers the case where the 200 OK is lost in transit so the client
retries the upload, only to then get UIA'd.

Complement tests: https://github.com/matrix-org/complement/pull/713 -
passing example
https://github.com/element-hq/synapse/actions/runs/7976948122/job/21778795094?pr=16943#step:7:8820

### Pull Request Checklist

<!-- Please read
https://element-hq.github.io/synapse/latest/development/contributing_guide.html
before submitting your pull request -->

* [x] Pull request is based on the develop branch
* [x] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog).
The entry should:
- Be a short description of your change which makes sense to users.
"Fixed a bug that prevented receiving messages from other servers."
instead of "Moved X method from `EventStore` to `EventWorkerStore`.".
  - Use markdown where necessary, mostly for `code blocks`.
  - End with either a period (.) or an exclamation mark (!).
  - Start with a capital letter.
- Feel free to credit yourself, by adding a sentence "Contributed by
@github_username." or "Contributed by [Your Name]." to the end of the
entry.
* [x] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html) is
correct
(run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))

---------

Co-authored-by: reivilibre <oliverw@matrix.org>
2024-04-15 10:57:56 +00:00
..
ui_auth Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
__init__.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
account_data.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
account_validity.py Merge remote-tracking branch 'gitlab/clokep/license-license' into new_develop 2023-12-13 15:11:56 +00:00
account.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
admin.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
appservice.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
auth.py Bump mypy from 1.5.1 to 1.8.0 (#16901) 2024-03-13 17:05:57 +00:00
cas.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
deactivate_account.py Fix reject knocks on deactivating account (#17010) 2024-03-21 18:05:54 +00:00
device.py Add a config to not send out device list updates for specific users (#16909) 2024-02-13 13:23:03 +00:00
devicemessage.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
directory.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
e2e_keys.py bugfix: make msc3967 idempotent (#16943) 2024-04-15 10:57:56 +00:00
e2e_room_keys.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
event_auth.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
events.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
federation_event.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
federation.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
identity.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
initial_sync.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
jwt.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
message.py Improve event validation (#16908) 2024-03-19 17:52:53 +00:00
oidc.py Add OIDC config to add extra parameters to the authorize URL (#16971) 2024-03-22 10:35:11 +00:00
pagination.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
password_policy.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
presence.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
profile.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
push_rules.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
read_marker.py Do not refuse to set read_marker if previous event_id is in wrong room (#16990) 2024-03-21 18:43:07 +00:00
receipts.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
register.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
relations.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
room_list.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
room_member_worker.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
room_member.py Fixups to new push stream (#17038) 2024-03-28 16:29:23 +00:00
room_summary.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
room.py Fix PR #16677, a parameter was missing in a function call (#17033) 2024-04-09 14:06:46 +01:00
saml.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
search.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
send_email.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
set_password.py Update license headers 2023-11-21 15:29:58 -05:00
sso.py Bump mypy from 1.5.1 to 1.8.0 (#16901) 2024-03-13 17:05:57 +00:00
state_deltas.py Update license headers 2023-11-21 15:29:58 -05:00
stats.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
sync.py Also check if first event matches the last in prev batch (#17066) 2024-04-09 14:01:12 +00:00
typing.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
user_directory.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
worker_lock.py Improve lock performance when a lot of locks are waiting (#16840) 2024-03-14 13:49:54 +00:00