anonymousland-synapse/synapse/handlers
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
..
ui_auth Update the auth providers to be async. (#7935) 2020-07-23 15:45:39 -04:00
__init__.py Fix registration on workers (#4682) 2019-02-20 18:47:31 +11:00
_base.py Convert _base, profile, and _receipts handlers to async/await (#7860) 2020-07-17 07:08:30 -04:00
account_data.py Remove unused get_pagination_rows methods. (#6557) 2019-12-17 11:44:32 +00:00
account_validity.py Fix buggy condition in account validity handler (#7074) 2020-03-16 12:16:30 +00:00
acme_issuing_service.py Allow configuration of the path used for ACME account keys. 2019-06-24 13:51:22 +01:00
acme.py Convert ACME code to async/await. (#7989) 2020-08-03 07:09:33 -04:00
admin.py Fix up types and comments that refer to Deferreds. (#7945) 2020-07-24 10:53:25 -04:00
appservice.py Convert appservice to async. (#7973) 2020-07-30 07:27:39 -04:00
auth.py Update the auth providers to be async. (#7935) 2020-07-23 15:45:39 -04:00
cas_handler.py Do not use canonicaljson to magically handle decoding bytes from JSON. (#7802) 2020-07-10 14:30:08 -04:00
deactivate_account.py Follow-up to admin API to re-activate accounts (#7908) 2020-07-22 12:33:19 -04:00
device.py Fix TypeError in synapse.notifier (#7880) 2020-07-17 14:11:05 +01:00
devicemessage.py Convert the device message and pagination handlers to async/await. (#7678) 2020-06-16 08:06:17 -04:00
directory.py Convert directory handler to async/await (#7727) 2020-06-22 07:18:00 -04:00
e2e_keys.py Fix up types and comments that refer to Deferreds. (#7945) 2020-07-24 10:53:25 -04:00
e2e_room_keys.py Convert E2E key and room key handlers to async/await. (#7851) 2020-07-15 08:48:58 -04:00
events.py Stop the master relaying USER_SYNC for other workers (#7318) 2020-04-22 22:39:04 +01:00
federation.py Convert a synapse.events to async/await. (#7949) 2020-07-27 13:40:22 -04:00
groups_local.py Convert federation client to async/await. (#7975) 2020-07-30 08:01:33 -04:00
identity.py Fix up types and comments that refer to Deferreds. (#7945) 2020-07-24 10:53:25 -04:00
initial_sync.py Stop the master relaying USER_SYNC for other workers (#7318) 2020-04-22 22:39:04 +01:00
message.py Remove hacky error handling for inlineDeferreds. (#7950) 2020-07-27 08:35:56 -04:00
oidc_handler.py Ensure that HTML pages served from Synapse include headers to avoid embedding. 2020-07-02 09:58:31 -04:00
pagination.py Convert the device message and pagination handlers to async/await. (#7678) 2020-06-16 08:06:17 -04:00
password_policy.py Allow server admins to define and enforce a password policy (MSC2000). (#7118) 2020-03-26 16:51:13 +00:00
presence.py Convert state resolution to async/await (#7942) 2020-07-24 10:59:51 -04:00
profile.py Convert _base, profile, and _receipts handlers to async/await (#7860) 2020-07-17 07:08:30 -04:00
read_marker.py Port receipt and read markers to async/wait 2019-10-29 15:08:22 +00:00
receipts.py Convert _base, profile, and _receipts handlers to async/await (#7860) 2020-07-17 07:08:30 -04:00
register.py Convert replication code to async/await. (#7987) 2020-08-03 07:12:55 -04:00
room_list.py Convert room list handler to async/await. (#7912) 2020-07-21 07:51:48 -04:00
room_member_worker.py update_membership declaration: now always returns an event id. (#7809) 2020-07-09 13:01:42 +01:00
room_member.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
room.py Fix up types and comments that refer to Deferreds. (#7945) 2020-07-24 10:53:25 -04:00
saml_handler.py Add additional logging for SAML sessions. (#7971) 2020-07-29 13:54:44 -04:00
search.py Fix up types and comments that refer to Deferreds. (#7945) 2020-07-24 10:53:25 -04:00
set_password.py Hash passwords earlier in the password reset process (#7538) 2020-05-20 09:48:03 -04:00
state_deltas.py Convert user directory handler and related classes to async/await. (#7640) 2020-06-05 14:42:55 -04:00
stats.py Prevent join->join membership transitions changing member count (#7977) 2020-08-03 21:54:24 +01:00
sync.py Re-implement unread counts (#7736) 2020-07-29 18:26:55 +01:00
typing.py Allow moving typing off master (#7869) 2020-07-16 15:12:54 +01:00
user_directory.py Replace iteritems/itervalues/iterkeys with native versions. (#7692) 2020-06-15 07:03:36 -04:00