synapse-product/synapse/storage/data_stores/main/schema/delta/58
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
..
02remove_dup_outbound_pokes.sql bg update to clear out duplicate outbound_device_list_pokes (#7193) 2020-04-07 23:06:39 +01:00
03persist_ui_auth.sql Persist user interactive authentication sessions (#7302) 2020-04-30 13:47:49 -04:00
05cache_instance.sql.postgres Support any process writing to cache invalidation stream. (#7436) 2020-05-07 13:51:08 +01:00
06dlols_unique_idx.py Replace device_27_unique_idx bg update with a fg one (#7562) 2020-05-26 11:43:17 +01:00
08_media_safe_from_quarantine.sql.postgres Allow local media to be marked as safe from being quarantined. (#7718) 2020-06-22 08:04:14 -04:00
08_media_safe_from_quarantine.sql.sqlite Allow local media to be marked as safe from being quarantined. (#7718) 2020-06-22 08:04:14 -04:00
10drop_local_rejections_stream.sql fix migration, again 2020-07-10 12:18:35 +01:00
10federation_pos_instance_name.sql Add ability to shard the federation sender (#7798) 2020-07-10 18:26:36 +01:00
11user_id_seq.py Use a postgres sequence to generate guest user IDs 2020-07-16 13:00:25 +01:00
12room_stats.sql Prevent join->join membership transitions changing member count (#7977) 2020-08-03 21:54:24 +01:00
12unread_messages.sql Re-implement unread counts (#7736) 2020-07-29 18:26:55 +01:00