Skip to content
Snippets Groups Projects
Unverified Commit 83b0ea04 authored by Erik Johnston's avatar Erik Johnston Committed by GitHub
Browse files

Fix deleting of stale marker for device lists (#6819)

We were in fact only deleting stale marker when we got an incremental
update, rather than when we did a full resync.
parent 7f93eb19
Branches
Tags
No related merge requests found
Detect unknown remote devices and mark cache as stale.
...@@ -940,13 +940,6 @@ class DeviceStore(DeviceWorkerStore, DeviceBackgroundUpdateStore): ...@@ -940,13 +940,6 @@ class DeviceStore(DeviceWorkerStore, DeviceBackgroundUpdateStore):
lock=False, lock=False,
) )
# If we're replacing the remote user's device list cache presumably
# we've done a full resync, so we remove the entry that says we need
# to resync
self.db.simple_delete_txn(
txn, table="device_lists_remote_resync", keyvalues={"user_id": user_id},
)
def update_remote_device_list_cache(self, user_id, devices, stream_id): def update_remote_device_list_cache(self, user_id, devices, stream_id):
"""Replace the entire cache of the remote user's devices. """Replace the entire cache of the remote user's devices.
...@@ -1003,6 +996,13 @@ class DeviceStore(DeviceWorkerStore, DeviceBackgroundUpdateStore): ...@@ -1003,6 +996,13 @@ class DeviceStore(DeviceWorkerStore, DeviceBackgroundUpdateStore):
lock=False, lock=False,
) )
# If we're replacing the remote user's device list cache presumably
# we've done a full resync, so we remove the entry that says we need
# to resync
self.db.simple_delete_txn(
txn, table="device_lists_remote_resync", keyvalues={"user_id": user_id},
)
@defer.inlineCallbacks @defer.inlineCallbacks
def add_device_change_to_streams(self, user_id, device_ids, hosts): def add_device_change_to_streams(self, user_id, device_ids, hosts):
"""Persist that a user's devices have been updated, and which hosts """Persist that a user's devices have been updated, and which hosts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment