Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

device_unused_fallback_key_types doesn't appear in /sync until after a fallback key is uploaded #10618

Closed
turt2live opened this issue Aug 16, 2021 · 1 comment · Fixed by #10623
Labels
S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@turt2live
Copy link
Member

Description

matrix-org/matrix-spec-proposals#2732 states that a client can detect server support by looking for the device_unused_fallback_key_types field in /sync, however this field is only populated by Synapse once a fallback key is uploaded. This can leave clients looping a fallback key upload as they'll be forced to assume the fallback key support is there and that all their keys have been used, thus upload a new key, which leads to the server (possibly) not supporting it and ignoring the unknown fields, so the client syncs, doesn't see the field, uploads, repeat.

Further, clients like Element Web won't upload fallback keys for users if the server doesn't advertise this field on /sync, thus there are likely users out there missing the value of fallback keys.

Steps to reproduce

  • Be on a fresh account
  • Look for device_unused_fallback_key_types in the /sync response

Version information

  • Homeserver: localhost

If not matrix.org:

  • Version: 1.40.0

  • Install method:

  • Platform: Windows / Docker
@anoadragon453 anoadragon453 added S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. labels Aug 17, 2021
@anoadragon453
Copy link
Member

anoadragon453 commented Aug 17, 2021

The MSC states:

The device_unused_fallback_key_types parameter must be present if the server supports fallback keys. Clients can thus treat this field as an indication that the server supports fallback keys, and so only upload fallback keys to servers that support them.

Apologies for the breakage here. Related: #10479. The relevant code is:

if sync_result.device_unused_fallback_key_types:

And looks like the fix is just to remove the conditional.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants