Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Delete stale non-e2e devices for users #14038

Merged
merged 11 commits into from
Nov 29, 2022
Prev Previous commit
Apply suggestions from code review
Co-authored-by: Sean Quah <[email protected]>
  • Loading branch information
erikjohnston and squahtx authored Nov 29, 2022
commit f5927d7a9c6caa2e7428b53900c54ae1bab6da92
2 changes: 1 addition & 1 deletion synapse/handlers/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ async def check_device_registered(
raise errors.StoreError(500, "Couldn't generate a device ID.")

async def _prune_too_many_devices(self, user_id: str) -> None:
"""Delete any stale devices this user may have."""
"""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
Expand Down
2 changes: 1 addition & 1 deletion synapse/storage/databases/main/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ async def check_too_many_devices_for_user(self, user_id: str) -> Collection[str]
)

# We let users have up to ten devices without pruning.
if num_devices < 10:
if num_devices <= 10:
return ()

# We prune everything older than N days.
Expand Down