matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.82k stars 2.13k forks source link

Fix using dehydrated devices & refresh tokens #16288

Closed hanadi92 closed 1 year ago

hanadi92 commented 1 year ago

Short description of the fix:

During re-hydration, after setting the access tokens from the current requester device to the re-hydrated device, we move the current device refresh tokens to the re-hydrated device as well. Technically, update the fields with old device id to the re-hydrated device id.

This is regarding the dehydrated devices feature msc2697. Please check 16284 for bug description.

Pull Request Checklist

Signed-off-by: Hanadi

This PR is related to this issue : fixes 16284

hanadi92 commented 1 year ago

A sytest fails tests/48admin.pl "After /purge_history users still get pushed for new messages". I'm not quite sure that it is related to the changes of this PR. Please advise :)

DMRobertson commented 1 year ago

Known flake: https://github.com/matrix-org/sytest/issues/1368

clokep commented 1 year ago

@hanadi92 There's no need to continually rebase, we'll review you work and if needed develop can be merged in.