-
Notifications
You must be signed in to change notification settings - Fork 186
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
Move call invite filtering logic to filter_events_for_client
#17782
base: develop
Are you sure you want to change the base?
Conversation
This allows SSS to benefit from it as well.
9d9789d
to
287d44f
Compare
It appears there's an additional DB transaction as the JoinRules state chunk is not cached for these tests.
287d44f
to
65d8bea
Compare
@@ -117,7 +118,7 @@ async def filter_events_for_client( | |||
[event.event_id for event in events], | |||
) | |||
|
|||
types = (_HISTORY_VIS_KEY, (EventTypes.Member, user_id)) | |||
types = (_HISTORY_VIS_KEY, (EventTypes.Member, user_id), (EventTypes.JoinRules, "")) |
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.
filter_events_for_client(...)
is a pretty slow operation already and a hot path for so many endpoints.
It would be good to conditionally request EventTypes.JoinRules
only if we see an event of type EventTypes.CallInvite
.
@@ -1181,7 +1181,7 @@ def assert_annotations(bundled_aggregations: JsonDict) -> None: | |||
bundled_aggregations, | |||
) | |||
|
|||
self._test_bundled_aggregations(RelationTypes.REFERENCE, assert_annotations, 6) | |||
self._test_bundled_aggregations(RelationTypes.REFERENCE, assert_annotations, 7) |
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.
To explain this change; the extra database call is because (EventTypes.JoinRules, "")
was added to the types
we query for in filter_events_for_client(...)
Fixes #17359. Follow-up to #16908
This allows Simplified Sliding Sync to also filter call invites events in public rooms.