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

Commit bf69b57

Browse files
authored
Fix "'int' object is not iterable" error in set_device_id_for_pushers background update (#16594)
A regression from removing the cursor_to_dict call, adds back the wrapping into a tuple.
1 parent c5b5439 commit bf69b57

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

changelog.d/16594.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix "'int' object is not iterable" error in `set_device_id_for_pushers` background update introduced in Synapse 1.95.0.

synapse/storage/databases/main/pusher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ def set_device_id_for_pushers_txn(txn: LoggingTransaction) -> int:
601601
(last_pusher_id, batch_size),
602602
)
603603

604-
rows = txn.fetchall()
604+
rows = cast(List[Tuple[int, Optional[str], Optional[str]]], txn.fetchall())
605605
if len(rows) == 0:
606606
return 0
607607

@@ -617,7 +617,7 @@ def set_device_id_for_pushers_txn(txn: LoggingTransaction) -> int:
617617
txn=txn,
618618
table="pushers",
619619
key_names=("id",),
620-
key_values=[row[0] for row in rows],
620+
key_values=[(row[0],) for row in rows],
621621
value_names=("device_id", "access_token"),
622622
# If there was already a device_id on the pusher, we only want to clear
623623
# the access_token column, so we keep the existing device_id. Otherwise,

0 commit comments

Comments
 (0)