-
Notifications
You must be signed in to change notification settings - Fork 423
Add memberships admin API
#19260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Add memberships admin API
#19260
Conversation
b5263c3 to
f845b3f
Compare
f845b3f to
a9f0db8
Compare
a9f0db8 to
ded0f1f
Compare
|
|
||
| return frozenset(room_ids) | ||
|
|
||
| async def get_memberships_for_user(self, user_id: str) -> dict[str, str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want a cache here ? if yes we also need to add invalidation.
I didn't do it because it should be used not that often since it is only used by the admin API (for now).
| return dict(rows) | ||
|
|
||
| @cached(max_entries=500000, iterable=True) | ||
| async def get_rooms_for_user(self, user_id: str) -> frozenset[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change this to use get_memberships_for_user ? it will pull quite a lot more data and this is used in a lot of places so I am tempted to not touch it to not affect performances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option would be to make get_memberships_for_user take a list of membership we are interested in, with empty meaning everything.
In this case the perf would be basically the same (with a cache on get_memberships_for_user and not on get_rooms_for_user anymore).
Add
membershipsendpoint to the admin API. This is useful for forensics and T&S purpose.Pull Request Checklist
EventStoretoEventWorkerStore.".code blocks.