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

we really shouldn't accept to_device messages for non-existent devices #3656

Closed
richvdh opened this issue Aug 6, 2018 · 3 comments
Closed
Labels
z-minor (Deprecated Label) z-p2 (Deprecated Label)

Comments

@richvdh
Copy link
Member

richvdh commented Aug 6, 2018

we sometimes get to_device messages for devices which have been deleted (for example, because clients send key_requests for them. They then just sit in device_inbox and fill up the disk.

@neilisfragile neilisfragile added z-p2 (Deprecated Label) z-minor (Deprecated Label) labels Aug 28, 2018
@richvdh
Copy link
Member Author

richvdh commented Nov 2, 2020

related: #3599

@richvdh richvdh changed the title we really shouldn't accept to_device messages for old devices we really shouldn't accept to_device messages for non-existent devices Nov 2, 2020
@anoadragon453
Copy link
Member

After some local testing, it looks as if we do ignore to_device messages - both from federation and local clients - to devices that don't exist. I believe this line enforces that:

# Only insert into the local inbox if the device exists on
# this server
device_id = row["device_id"]
message_json = json_encoder.encode(messages_by_device[device_id])
messages_json_for_user[device_id] = message_json

However, element-hq/element-web#15638 shows (and I can confirm a similar situation on my own homeserver) that to_device messages to public cross-signing keys are being captured and stored forever. They are also the most prevalent for my user in my homeserver's database.

So one of the main problems with device_inbox table growth may not be that we're not ignoring messages to unknown devices, as we do seem to be doing so. The cross-signing keys seem to be real devices that exist in the devices table.

@anoadragon453
Copy link
Member

I think this can be closed in favour of #9348.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
z-minor (Deprecated Label) z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

3 participants