This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Synapse accepts to_device messages to hidden devices #9348
Comments
anoadragon453
added
S-Minor
Blocks non-critical functionality, workarounds exist.
T-Defect
Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
labels
Feb 8, 2021
anoadragon453
changed the title
Synapse accept to_device messages to hidden devices
Synapse accepts to_device messages to hidden devices
Feb 8, 2021
Related to #3656 |
I'd like to see a solution which:
delete from device_inbox where device_id in (select device_id from devices where hidden = true); |
JohannesKleine
added a commit
to JohannesKleine/synapse
that referenced
this issue
May 30, 2021
4 tasks
4 tasks
JohannesKleine
added a commit
to JohannesKleine/synapse
that referenced
this issue
Jun 1, 2021
4 tasks
4 tasks
Should this be closed? AFAICS #11199 will delete the stuff we don't want on Synapse start up, but it won't address the first two bullets in @anoadragon453's #9348 (comment). |
@DMRobertson #10097 should address the first two points, and has been merged. I'm not sure if it's worth keeping this open for #11199, unless we're specifically tracking this issue. The third bullet point was mostly mentioned as a nice-to-have. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As part of cross-signing, devices for the master, self-signing and user-signing cross-signing keys are created and stored in the
devices
table.These devices should not be getting
to_device
messages sent to them, as they will never be read by any client. It turns out that it is possible to haveto_device
messages aimed at them in thedevice_inbox
table through the following:to_device
messages to one of your cross-signing public keys. These happen to be the device IDs of these hidden devices. Synapse doesn't condition on the device being hidden, and so will accept them. It should be doing so here:synapse/synapse/storage/databases/main/deviceinbox.py
Lines 499 to 506 in 6633a40
to_device
messages to all devices of a user, by specifying*
as the target. Synapse will then create ato_device
message for all devices of a user, including hidden ones:synapse/synapse/storage/databases/main/deviceinbox.py
Lines 486 to 498 in c7b8235
These messages were never getting read, and thus piling up in the database forever. In my testing they didn't seem to be using that much space however. Upon removing them for all users on my homeserver and vacuuming the table,
the size ofEdit: I don't think this is accurate. After deleting over half the table in a different cleanup and REINDEX+VACUUMing I also only dropped after 10MB.device_inbox
only went from 3420MB to 3410MB.Initially presumed as a client-side issue, before we discovered Synapse was at fault: element-hq/element-web#15638
Related: #3599
The text was updated successfully, but these errors were encountered: