summary refs log tree commit diff
path: root/synapse/handlers/device.py
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-12-01 13:43:30 +0000
committerDavid Robertson <davidr@element.io>2022-12-01 13:43:30 +0000
commit781b14ec69897a3b993fc46e43480a04cf2ad5f4 (patch)
tree169c9f3cfe3246c3a76fd9627e8ae917a012901a /synapse/handlers/device.py
parentModernize unit tests configuration settings for workers. (#14568) (diff)
parent1.73.0rc2 (diff)
downloadsynapse-781b14ec69897a3b993fc46e43480a04cf2ad5f4.tar.xz
Merge branch 'release-v1.73' into develop
Diffstat (limited to 'synapse/handlers/device.py')
-rw-r--r--synapse/handlers/device.py13
1 files changed, 1 insertions, 12 deletions
diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py
index 7c4dd8cf5a..b1e55e1b9e 100644
--- a/synapse/handlers/device.py
+++ b/synapse/handlers/device.py
@@ -421,9 +421,6 @@ class DeviceHandler(DeviceWorkerHandler):
 
         self._check_device_name_length(initial_device_display_name)
 
-        # Prune the user's device list if they already have a lot of devices.
-        await self._prune_too_many_devices(user_id)
-
         if device_id is not None:
             new_device = await self.store.store_device(
                 user_id=user_id,
@@ -455,14 +452,6 @@ class DeviceHandler(DeviceWorkerHandler):
 
         raise errors.StoreError(500, "Couldn't generate a device ID.")
 
-    async def _prune_too_many_devices(self, user_id: str) -> None:
-        """Delete any excess old devices this user may have."""
-        device_ids = await self.store.check_too_many_devices_for_user(user_id)
-        if not device_ids:
-            return
-
-        await self.delete_devices(user_id, device_ids)
-
     async def _delete_stale_devices(self) -> None:
         """Background task that deletes devices which haven't been accessed for more than
         a configured time period.
@@ -492,7 +481,7 @@ class DeviceHandler(DeviceWorkerHandler):
             device_ids = [d for d in device_ids if d != except_device_id]
         await self.delete_devices(user_id, device_ids)
 
-    async def delete_devices(self, user_id: str, device_ids: Collection[str]) -> None:
+    async def delete_devices(self, user_id: str, device_ids: List[str]) -> None:
         """Delete several devices
 
         Args: