From df95d3aec216f3ee73b162677ca2fca9c30289b4 Mon Sep 17 00:00:00 2001 From: Sean Quah <8349537+squahtx@users.noreply.github.com> Date: Wed, 20 Oct 2021 11:05:29 +0100 Subject: Revert change to counting of deactivated users towards the monthly active users limit (#11127) Temporarily revert "Add functionality to remove deactivated users from the monthly_active_users table (#10947)". This reverts commit eda8c88b84ee7506379a71ac2a7a88c08b759d43. --- synapse/handlers/deactivate_account.py | 4 ---- .../storage/databases/main/monthly_active_users.py | 24 ---------------------- 2 files changed, 28 deletions(-) (limited to 'synapse') 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", () - ) -- cgit 1.5.1 From 522489fbcdfd4f52f1ebbbf5670c474cbf3e29be Mon Sep 17 00:00:00 2001 From: Sean Quah Date: Wed, 20 Oct 2021 12:00:03 +0100 Subject: 1.45.1 --- CHANGES.md | 9 +++++++++ changelog.d/11127.bugfix | 1 - debian/changelog | 6 ++++++ synapse/__init__.py | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) delete mode 100644 changelog.d/11127.bugfix (limited to 'synapse') diff --git a/CHANGES.md b/CHANGES.md index 435387d7b0..4b7dd69c96 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,12 @@ +Synapse 1.45.1 (2021-10-20) +=========================== + +Bugfixes +-------- + +- Revert change to counting of deactivated users towards the monthly active users limit, introduced in 1.45.0rc1 ([\#10947](https://github.com/matrix-org/synapse/issues/10947)). ([\#11127](https://github.com/matrix-org/synapse/issues/11127)) + + Synapse 1.45.0 (2021-10-19) =========================== diff --git a/changelog.d/11127.bugfix b/changelog.d/11127.bugfix deleted file mode 100644 index 54417a9975..0000000000 --- a/changelog.d/11127.bugfix +++ /dev/null @@ -1 +0,0 @@ -Revert change to counting of deactivated users towards the monthly active users limit ([\#10947](https://github.com/matrix-org/synapse/issues/10947)). diff --git a/debian/changelog b/debian/changelog index 5fefb2f2ac..1ee81f2a34 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +matrix-synapse-py3 (1.45.1) stable; urgency=medium + + * New synapse release 1.45.1. + + -- Synapse Packaging team Wed, 20 Oct 2021 11:58:27 +0100 + matrix-synapse-py3 (1.45.0) stable; urgency=medium * New synapse release 1.45.0. 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 -- cgit 1.5.1