synapse/tests/rest/client/v1
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
..
__init__.py Fix flake8 warnings for tests 2016-02-19 15:34:38 +00:00
test_directory.py Remove special casing of m.room.aliases events (#7034) 2020-03-17 07:37:04 -04:00
test_events.py Performance improvements and refactor of Ratelimiter (#7595) 2020-06-05 10:47:20 +01:00
test_login.py Return the proper 403 Forbidden error during errors with JWT logins. (#7844) 2020-07-15 07:10:21 -04:00
test_presence.py Fix some spelling mistakes / typos. (#7811) 2020-07-09 09:52:58 -04:00
test_profile.py Add option to allow profile queries without sharing a room (#6523) 2019-12-16 16:11:55 +00:00
test_rooms.py Replace all remaining six usage with native Python 3 equivalents (#7704) 2020-06-16 08:51:47 -04:00
test_typing.py Performance improvements and refactor of Ratelimiter (#7595) 2020-06-05 10:47:20 +01:00
utils.py Prevent join->join membership transitions changing member count (#7977) 2020-08-03 21:54:24 +01:00