synapse/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 Performance improvements and refactor of Ratelimiter (#7595) 2020-06-05 10:47:20 +01:00
app Create a ListenerConfig object (#7681) 2020-06-16 12:44:07 +01:00
appservice Convert appservice to async. (#7973) 2020-07-30 07:27:39 -04:00
config Fix specifying cache factors via env vars with * in name. (#7580) 2020-05-27 13:17:01 +01:00
crypto Convert the crypto module to async/await. (#8003) 2020-08-03 08:29:01 -04:00
events Convert the message handler to async/await. (#7884) 2020-07-22 12:29:15 -04:00
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 Fix for structured logging tests stomping on logs (#6023) 2019-09-13 02:29:55 +10:00
module_api Wrap register_device coroutine in an ensureDeferred (#7684) 2020-06-16 10:13:59 +01:00
push Don't ignore set_tweak actions with no explicit value. (#7766) 2020-07-06 11:43:41 +01:00
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 Port register_new_matrix_user to Python 3 and add tests (#4085) 2018-10-26 22:05:22 +11:00
server_notices Optimise some references to hs.config (#7546) 2020-05-22 21:47:07 +01:00
state Convert state resolution to async/await (#7942) 2020-07-24 10:59:51 -04:00
storage Convert some of the data store to async. (#7976) 2020-07-30 07:20:41 -04:00
test_utils Convert state resolution to async/await (#7942) 2020-07-24 10:59:51 -04:00
util Fix some spelling mistakes / typos. (#7811) 2020-07-09 09:52:58 -04:00
__init__.py Move patch_inline_callbacks into synapse/ 2019-10-10 10:53:06 +01:00
server.py Fix client reader sharding tests (#7853) 2020-07-15 15:27:35 +01:00
test_distributor.py Run black. 2018-08-10 23:54:09 +10:00
test_event_auth.py Implement room version 6 (MSC2240). (#7506) 2020-05-15 09:30:10 -04:00
test_federation.py Convert federation client to async/await. (#7975) 2020-07-30 08:01:33 -04:00
test_mau.py Fix some spelling mistakes / typos. (#7811) 2020-07-09 09:52:58 -04:00
test_metrics.py Allow configuration of Synapse's cache without using synctl or environment variables (#6391) 2020-05-11 18:45:23 +01:00
test_phone_home.py Remove the psutil dependency (#6318) 2019-11-05 05:05:48 +11:00
test_preview.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00
test_server.py Implement handling of HTTP HEAD requests. (#7999) 2020-08-03 08:45:42 -04:00
test_state.py Convert a synapse.events to async/await. (#7949) 2020-07-27 13:40:22 -04:00
test_terms_auth.py Replace all remaining six usage with native Python 3 equivalents (#7704) 2020-06-16 08:51:47 -04:00
test_test_utils.py Run black. 2018-08-10 23:54:09 +10:00
test_types.py Validate the alt_aliases property of canonical alias events (#6971) 2020-03-03 07:12:45 -05:00
test_visibility.py Convert storage layer to async/await. (#7963) 2020-07-28 16:09:53 -04:00
unittest.py Convert the message handler to async/await. (#7884) 2020-07-22 12:29:15 -04:00
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