0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-14 02:43:45 +01:00
synapse/tests/rest
Andrew Morgan 5d92a1428c
Prevent join->join membership transitions changing member count (#7977)
`StatsHandler` handles updates to the `current_state_delta_stream`, and updates room stats such as the amount of state events, joined users, etc.

However, it counts every new join membership as a new user entering a room (and that user being in another room), whereas it's possible for a user's membership status to go from join -> join, for instance when they change their per-room profile information.

This PR adds a check for join->join membership transitions, and bails out early, as none of the further checks are necessary at that point.

Due to this bug, membership stats in many rooms have ended up being wildly larger than their true values. I am not sure if we also want to include a migration step which recalculates these statistics (possibly using the `_populate_stats_process_rooms` bg update).

Bug introduced in the initial implementation https://github.com/matrix-org/synapse/pull/4338.
2020-08-03 21:54:24 +01:00
..
admin Convert federation client to async/await. (#7975) 2020-07-30 08:01:33 -04:00
client Prevent join->join membership transitions changing member count (#7977) 2020-08-03 21:54:24 +01:00
key Convert federation client to async/await. (#7975) 2020-07-30 08:01:33 -04:00
media Support oEmbed for media previews. (#7920) 2020-07-27 07:50:44 -04:00
__init__.py copyrights 2016-01-07 04:26:29 +00:00
test_well_known.py Run Black on the tests again (#5170) 2019-05-10 00:12:11 -05:00