MatrixSynapse/tests
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
..
api
app
appservice Convert appservice to async. (#7973) 2020-07-30 07:27:39 -04:00
config
crypto Convert the crypto module to async/await. (#8003) 2020-08-03 08:29:01 -04:00
events
federation Convert federation client to async/await. (#7975) 2020-07-30 08:01:33 -04:00
handlers Prevent join->join membership transitions changing member count (#7977) 2020-08-03 21:54:24 +01:00
http Convert federation client to async/await. (#7975) 2020-07-30 08:01:33 -04:00
logging
module_api
push
replication Convert federation client to async/await. (#7975) 2020-07-30 08:01:33 -04:00
rest Prevent join->join membership transitions changing member count (#7977) 2020-08-03 21:54:24 +01:00
scripts
server_notices
state
storage Convert some of the data store to async. (#7976) 2020-07-30 07:20:41 -04:00
test_utils
util
__init__.py
server.py
test_distributor.py
test_event_auth.py
test_federation.py Convert federation client to async/await. (#7975) 2020-07-30 08:01:33 -04:00
test_mau.py
test_metrics.py
test_phone_home.py
test_preview.py
test_server.py Implement handling of HTTP HEAD requests. (#7999) 2020-08-03 08:45:42 -04:00
test_state.py
test_terms_auth.py
test_test_utils.py
test_types.py
test_visibility.py
unittest.py
utils.py Merge branch 'develop' of github.com:matrix-org/synapse into erikj/add_rate_limiting_to_joins 2020-07-31 15:07:01 +01:00