summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-06-07 11:20:47 +0100
committerErik Johnston <erik@matrix.org>2017-06-07 11:20:47 +0100
commit64ed74c01efa035a2c9d95c97b1bf1b1f1c83ff6 (patch)
tree7e3d1e6199a6b8b79d49223395ff543e5314bccd /synapse/storage
parentKeep pruning background task (diff)
downloadsynapse-64ed74c01efa035a2c9d95c97b1bf1b1f1c83ff6.tar.xz
When pruning, delete from device_lists_outbound_last_success
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/devices.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/storage/devices.py b/synapse/storage/devices.py
index 83b1d2eeba..bb27fd1f70 100644
--- a/synapse/storage/devices.py
+++ b/synapse/storage/devices.py
@@ -681,6 +681,14 @@ class DeviceStore(SQLBaseStore):
                 )
             )
 
+            # Since we've deleted unsent deltas, we need to remove the entry
+            # of last successful sent so that the prev_ids are correctly set.
+            sql = """
+                DELETE FROM device_lists_outbound_last_success
+                WHERE destination = ? AND user_id = ?
+            """
+            txn.executemany(sql, ((row[0], row[1]) for row in rows))
+
             logger.info("Pruned %d device list outbound pokes", txn.rowcount)
 
         return self.runInteraction(