From 7987d5e638b3c60494f4695f67bc0000a804f68d Mon Sep 17 00:00:00 2001 From: Jason Little Date: Wed, 30 Oct 2024 19:34:11 -0500 Subject: [PATCH] Remove `Generator` in `_quarantine_media_txn()` (#17813) --- changelog.d/17813.bugfix | 1 + synapse/storage/databases/main/room.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/17813.bugfix diff --git a/changelog.d/17813.bugfix b/changelog.d/17813.bugfix new file mode 100644 index 000000000..5dd276709 --- /dev/null +++ b/changelog.d/17813.bugfix @@ -0,0 +1 @@ +Avoid lost data on some database query retries. diff --git a/synapse/storage/databases/main/room.py b/synapse/storage/databases/main/room.py index e0b7b7e19..33569a439 100644 --- a/synapse/storage/databases/main/room.py +++ b/synapse/storage/databases/main/room.py @@ -1175,7 +1175,7 @@ class RoomWorkerStore(CacheInvalidationWorkerStore): SET quarantined_by = ? WHERE media_origin = ? AND media_id = ? """, - ((quarantined_by, origin, media_id) for origin, media_id in remote_mxcs), + [(quarantined_by, origin, media_id) for origin, media_id in remote_mxcs], ) total_media_quarantined += txn.rowcount if txn.rowcount > 0 else 0