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

Fix deleting of stale marker for device lists #6819

Merged
merged 2 commits into from
Jan 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/6819.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Detect unknown remote devices and mark cache as stale.
14 changes: 7 additions & 7 deletions synapse/storage/data_stores/main/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,13 +940,6 @@ def _update_remote_device_list_cache_entry_txn(
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):
"""Replace the entire cache of the remote user's devices.

Expand Down Expand Up @@ -1003,6 +996,13 @@ def _update_remote_device_list_cache_txn(self, txn, user_id, devices, stream_id)
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
def add_device_change_to_streams(self, user_id, device_ids, hosts):
"""Persist that a user's devices have been updated, and which hosts
Expand Down