synapse
synapse copied to clipboard
Fix deduplicating of membership events to not create unused state groups.
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
This line in the create_event function doc is now out of date: https://github.com/element-hq/synapse/blob/68dca8076fd992d3dc59c38287ab6183a073874d/synapse/handlers/message.py#L597