diff options
author | Sean Quah <seanq@element.io> | 2021-10-20 13:43:02 +0100 |
---|---|---|
committer | Sean Quah <seanq@element.io> | 2021-10-20 13:43:02 +0100 |
commit | ee2cee5f529402e060e0a1567b438d2b6026cddb (patch) | |
tree | f672584864e2aa1cf22b02231b2a092accfddf91 /synapse | |
parent | Remove false warning about copying the log config to a homeserver.yaml (#11092) (diff) | |
parent | Remove link to #10947 from changelog (diff) | |
download | synapse-ee2cee5f529402e060e0a1567b438d2b6026cddb.tar.xz |
Merge branch 'master' into develop
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/__init__.py | 2 | ||||
-rw-r--r-- | synapse/handlers/deactivate_account.py | 4 | ||||
-rw-r--r-- | synapse/storage/databases/main/monthly_active_users.py | 24 |
3 files changed, 1 insertions, 29 deletions
diff --git a/synapse/__init__.py b/synapse/__init__.py index 97452f34fe..2687d932ea 100644 --- a/synapse/__init__.py +++ b/synapse/__init__.py @@ -47,7 +47,7 @@ try: except ImportError: pass -__version__ = "1.45.0" +__version__ = "1.45.1" if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)): # We import here so that we don't have to install a bunch of deps when diff --git a/synapse/handlers/deactivate_account.py b/synapse/handlers/deactivate_account.py index e88c3c27ce..bee62cf360 100644 --- a/synapse/handlers/deactivate_account.py +++ b/synapse/handlers/deactivate_account.py @@ -131,10 +131,6 @@ class DeactivateAccountHandler: # delete from user directory await self.user_directory_handler.handle_local_user_deactivated(user_id) - # If the user is present in the monthly active users table - # remove them - await self.store.remove_deactivated_user_from_mau_table(user_id) - # Mark the user as erased, if they asked for that if erase_data: user = UserID.from_string(user_id) diff --git a/synapse/storage/databases/main/monthly_active_users.py b/synapse/storage/databases/main/monthly_active_users.py index ec4d47a560..a14ac03d4b 100644 --- a/synapse/storage/databases/main/monthly_active_users.py +++ b/synapse/storage/databases/main/monthly_active_users.py @@ -354,27 +354,3 @@ class MonthlyActiveUsersStore(MonthlyActiveUsersWorkerStore): await self.upsert_monthly_active_user(user_id) elif now - last_seen_timestamp > LAST_SEEN_GRANULARITY: await self.upsert_monthly_active_user(user_id) - - async def remove_deactivated_user_from_mau_table(self, user_id: str) -> None: - """ - Removes a deactivated user from the monthly active user - table and resets affected caches. - - Args: - user_id(str): the user_id to remove - """ - - rows_deleted = await self.db_pool.simple_delete( - table="monthly_active_users", - keyvalues={"user_id": user_id}, - desc="simple_delete", - ) - - if rows_deleted != 0: - await self.invalidate_cache_and_stream( - "user_last_seen_monthly_active", (user_id,) - ) - await self.invalidate_cache_and_stream("get_monthly_active_count", ()) - await self.invalidate_cache_and_stream( - "get_monthly_active_count_by_service", () - ) |