summary refs log tree commit diff
path: root/synapse/handlers/device.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2021-04-22 16:53:24 +0100
committerGitHub <noreply@github.com>2021-04-22 16:53:24 +0100
commit69018acbd2d1f331d6a52335b4938c3753b16de6 (patch)
tree00d9527b8a0bd4451acd41b6d59f07fb563082bb /synapse/handlers/device.py
parentRemove `synapse.types.Collection` (#9856) (diff)
downloadsynapse-69018acbd2d1f331d6a52335b4938c3753b16de6.tar.xz
Clear the resync bit after resyncing device lists (#9867)
Fixes #9866.
Diffstat (limited to 'synapse/handlers/device.py')
-rw-r--r--synapse/handlers/device.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py
index 34d39e3b44..95bdc5902a 100644
--- a/synapse/handlers/device.py
+++ b/synapse/handlers/device.py
@@ -925,6 +925,10 @@ class DeviceListUpdater:
         else:
             cached_devices = await self.store.get_cached_devices_for_user(user_id)
             if cached_devices == {d["device_id"]: d for d in devices}:
+                logging.info(
+                    "Skipping device list resync for %s, as our cache matches already",
+                    user_id,
+                )
                 devices = []
                 ignore_devices = True
 
@@ -940,6 +944,9 @@ class DeviceListUpdater:
             await self.store.update_remote_device_list_cache(
                 user_id, devices, stream_id
             )
+        # mark the cache as valid, whether or not we actually processed any device
+        # list updates.
+        await self.store.mark_remote_user_device_cache_as_valid(user_id)
         device_ids = [device["device_id"] for device in devices]
 
         # Handle cross-signing keys.