-
Notifications
You must be signed in to change notification settings - Fork 95
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
Fix deduplicating of membership events to not create unused state groups. #17164
Conversation
We try and deduplicate in two places: 1) really early on, and 2) just before we persist the event. The first case was broken due to it occuring before the profile information was added, and so it thought the event contents were different. The second case did catch it and handle it correctly, however doing so creates a redundant state group leading to bloat.
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.
This fix looks good to me & makes sense as to why it fixes the issue.
I would feel more comfortable if someone more familiar with this section of code also takes a look before this PR is approved.
This line in the synapse/synapse/handlers/message.py Line 597 in 68dca80
|
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.
A couple nits, but otherwise LGTM!
synapse/handlers/room_member.py
Outdated
@@ -106,6 +106,13 @@ def __init__(self, hs: "HomeServer"): | |||
self.event_auth_handler = hs.get_event_auth_handler() | |||
self._worker_lock_handler = hs.get_worker_locks_handler() | |||
|
|||
self.membership_types_to_include_profile_data_in = { |
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.
nit: self.membership_types_to_include_profile_data_in
should have a leading underscore.
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
…ups. (element-hq#17164) We try and deduplicate in two places: 1) really early on, and 2) just before we persist the event. The first case was broken due to it occuring before the profile information was added, and so it thought the event contents were different. The second case did catch it and handle it correctly, however doing so creates a redundant state group leading to bloat. Fixes element-hq#3791
We try and deduplicate in two places: 1) really early on, and 2) just before we persist the event. The first case was broken due to it occuring before the profile information was added, and so it thought the event contents were different.
The second case did catch it and handle it correctly, however doing so creates a redundant state group leading to bloat.
Fixes #3791