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

Only send devicelist updates for users with whom you share an encrypted room? #7524

Open
ara4n opened this issue May 18, 2020 · 5 comments
Open
Labels
A-Device-List-Tracking Telling clients about other devices. Often related to E2EE. A-Performance Performance, both client-facing and admin-facing T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. z-p2 (Deprecated Label)

Comments

@ara4n
Copy link
Member

ara4n commented May 18, 2020

No description provided.

@anoadragon453 anoadragon453 added A-Device-List-Tracking Telling clients about other devices. Often related to E2EE. enhancement z-p2 (Deprecated Label) A-Performance Performance, both client-facing and admin-facing labels May 18, 2020
@Half-Shot
Copy link
Collaborator

Half-Shot commented Feb 27, 2021

Problematically, this also includes appservice users (e.g. every time a freenode user joins a room and you've not seen them before, that's a device list update that has to happen). This could surely be trivially filtered out.

@ShadowJonathan
Copy link
Contributor

I'm currently poking at making a PR for this, as this is inhibiting some performance on my server (with quite a lot of people visible), however, i'm not 100% sure if Element could handle this bug-free.

@erikjohnston erikjohnston added T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. and removed z-enhancement labels Jul 26, 2021
@ShadowJonathan
Copy link
Contributor

#11974 takes a lot of "pressure" off of the performance issue that this issue likes to address. (i came across it while rebasing a local patchset)

@anoadragon453
Copy link
Member

anoadragon453 commented Jan 31, 2023

For the federation side of this, I believe you'd only need to restrict this query to encrypted rooms:

room_ids = await self.store.get_rooms_for_user(user_id)

Edit: A potential problem would be trying to verify a user whom you don't share an encrypted room with. You wouldn't know whether you had an up-to-date copy of their device list. Perhaps in the case that we don't share an encrypted room with a user, we should always consider that user's devices out of date, and always requery them from the remote homeserver when a client calls /keys/query? Would still be a net gain in performance in theory.

@ShadowJonathan
Copy link
Contributor

ShadowJonathan commented Jan 31, 2023

Federation isn't a problem for me personally, that is just a slightly increased average load, the real problem is (initial) sync time, as not iterating rooms that aren't encrypted for device list updates cuts that time substantially.

Having worked on related tests in complement in the meantime, I know this is technically not spec (or at least complement) compliant, so that's why I didn't really keep pushing it forward into a PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Device-List-Tracking Telling clients about other devices. Often related to E2EE. A-Performance Performance, both client-facing and admin-facing T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. z-p2 (Deprecated Label)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants