From d07944fc846284d3d50cc1f1eceeb157186d79da Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Thu, 2 Nov 2023 08:32:26 -0400 Subject: [PATCH 1/2] Properly pass tuples into simple_update_many_txn. --- synapse/storage/databases/main/pusher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synapse/storage/databases/main/pusher.py b/synapse/storage/databases/main/pusher.py index a6a1671bd649..8f36cfce1245 100644 --- a/synapse/storage/databases/main/pusher.py +++ b/synapse/storage/databases/main/pusher.py @@ -601,7 +601,7 @@ def set_device_id_for_pushers_txn(txn: LoggingTransaction) -> int: (last_pusher_id, batch_size), ) - rows = txn.fetchall() + rows = cast(List[Tuple[int, Optional[str], Optional[str]]], txn.fetchall()) if len(rows) == 0: return 0 @@ -617,7 +617,7 @@ def set_device_id_for_pushers_txn(txn: LoggingTransaction) -> int: txn=txn, table="pushers", key_names=("id",), - key_values=[row[0] for row in rows], + key_values=[(row[0],) for row in rows], value_names=("device_id", "access_token"), # If there was already a device_id on the pusher, we only want to clear # the access_token column, so we keep the existing device_id. Otherwise, From 43a023d0bda0a6a8febc0b2aeb4f073e8f08bbe7 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Thu, 2 Nov 2023 08:34:18 -0400 Subject: [PATCH 2/2] Newsfragment --- changelog.d/16594.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/16594.bugfix diff --git a/changelog.d/16594.bugfix b/changelog.d/16594.bugfix new file mode 100644 index 000000000000..701fa0dcdc17 --- /dev/null +++ b/changelog.d/16594.bugfix @@ -0,0 +1 @@ +Fix "'int' object is not iterable" error in `set_device_id_for_pushers` background update introduced in Synapse 1.95.0.