anonymousland-synapse/synapse
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
..
_scripts Replace all remaining six usage with native Python 3 equivalents (#7704) 2020-06-16 08:51:47 -04:00
api Convert a synapse.events to async/await. (#7949) 2020-07-27 13:40:22 -04:00
app Convert ACME code to async/await. (#7989) 2020-08-03 07:09:33 -04:00
appservice Convert appservice to async. (#7973) 2020-07-30 07:27:39 -04:00
config Merge branch 'develop' of github.com:matrix-org/synapse into erikj/add_rate_limiting_to_joins 2020-07-31 15:07:01 +01:00
crypto Convert the crypto module to async/await. (#8003) 2020-08-03 08:29:01 -04:00
events Convert a synapse.events to async/await. (#7949) 2020-07-27 13:40:22 -04:00
federation Merge branch 'master' into develop 2020-07-30 15:18:36 +01:00
groups Convert groups and visibility code to async / await. (#7951) 2020-07-27 12:32:08 -04:00
handlers Prevent join->join membership transitions changing member count (#7977) 2020-08-03 21:54:24 +01:00
http Implement handling of HTTP HEAD requests. (#7999) 2020-08-03 08:45:42 -04:00
logging Fix error reporting when using opentracing.trace (#7961) 2020-07-27 16:20:24 +01:00
metrics Improve stacktraces from exceptions in background processes (#7808) 2020-07-09 13:01:33 +01:00
module_api Wrap register_device coroutine in an ensureDeferred (#7684) 2020-06-16 10:13:59 +01:00
push Re-implement unread counts (#7736) 2020-07-29 18:26:55 +01:00
replication Convert replication code to async/await. (#7987) 2020-08-03 07:12:55 -04:00
res/templates Element CSS and logo in email templates (#7919) 2020-07-21 11:58:01 +01:00
rest Allow guests to operate in encrypted rooms (#7314) 2020-08-03 12:13:49 +01:00
server_notices Fix some comments and types in service notices (#7996) 2020-07-31 16:22:06 -04:00
spam_checker_api Add type hints to the spam check module (#6915) 2020-02-14 12:49:40 -05:00
state Convert state resolution to async/await (#7942) 2020-07-24 10:59:51 -04:00
static Clean-up the fallback login code. (#7657) 2020-06-10 09:50:39 -04:00
storage Prevent join->join membership transitions changing member count (#7977) 2020-08-03 21:54:24 +01:00
streams Fix some spelling mistakes / typos. (#7811) 2020-07-09 09:52:58 -04:00
util Fix deprecation warning: import ABC from collections.abc (#7892) 2020-07-20 13:33:04 -04:00
__init__.py Merge branch 'master' into develop 2020-07-30 15:18:36 +01:00
event_auth.py Fix recursion error when fetching auth chain over federation (#7817) 2020-07-10 18:15:35 +01:00
notifier.py Fix some spelling mistakes / typos. (#7811) 2020-07-09 09:52:58 -04:00
python_dependencies.py Use the JSON module from the std library instead of simplejson. (#7936) 2020-07-28 10:28:59 -04:00
secrets.py isort 5 compatibility (#7786) 2020-07-05 16:32:02 +01:00
server.py Allow moving typing off master (#7869) 2020-07-16 15:12:54 +01:00
server.pyi Fix typing replication not being handled on master (#7959) 2020-07-27 14:10:53 +01:00
types.py isort 5 compatibility (#7786) 2020-07-05 16:32:02 +01:00
visibility.py Convert groups and visibility code to async / await. (#7951) 2020-07-27 12:32:08 -04:00