mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 02:43:45 +01:00
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.
This commit is contained in:
parent
c5b543938b
commit
bf69b57422
2 changed files with 3 additions and 2 deletions
1
changelog.d/16594.bugfix
Normal file
1
changelog.d/16594.bugfix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Fix "'int' object is not iterable" error in `set_device_id_for_pushers` background update introduced in Synapse 1.95.0.
|
|
@ -601,7 +601,7 @@ class PusherBackgroundUpdatesStore(SQLBaseStore):
|
||||||
(last_pusher_id, batch_size),
|
(last_pusher_id, batch_size),
|
||||||
)
|
)
|
||||||
|
|
||||||
rows = txn.fetchall()
|
rows = cast(List[Tuple[int, Optional[str], Optional[str]]], txn.fetchall())
|
||||||
if len(rows) == 0:
|
if len(rows) == 0:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
@ -617,7 +617,7 @@ class PusherBackgroundUpdatesStore(SQLBaseStore):
|
||||||
txn=txn,
|
txn=txn,
|
||||||
table="pushers",
|
table="pushers",
|
||||||
key_names=("id",),
|
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"),
|
value_names=("device_id", "access_token"),
|
||||||
# If there was already a device_id on the pusher, we only want to clear
|
# 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,
|
# the access_token column, so we keep the existing device_id. Otherwise,
|
||||||
|
|
Loading…
Reference in a new issue