feat(store): also delete thread subscriptions when deleting a room in db

This commit is contained in:
Benjamin Bouvier
2025-07-28 16:56:15 +02:00
parent d57d3c4124
commit f37bf2f5d1
2 changed files with 8 additions and 0 deletions

View File

@@ -754,6 +754,7 @@ impl StateStore for MemoryStore {
inner.room_event_receipts.remove(room_id);
inner.send_queue_events.remove(room_id);
inner.dependent_send_queue_events.remove(room_id);
inner.thread_subscriptions.remove(room_id);
Ok(())
}

View File

@@ -1766,6 +1766,13 @@ impl StateStore for SqliteStateStore {
this.encode_key(keys::DEPENDENTS_SEND_QUEUE, &room_id);
txn.remove_room_dependent_send_queue(&dependent_send_queue_room_id)?;
let thread_subscriptions_room_id =
this.encode_key(keys::THREAD_SUBSCRIPTIONS, &room_id);
txn.execute(
"DELETE FROM thread_subscriptions WHERE room_id = ?",
(thread_subscriptions_room_id,),
)?;
Ok(())
})
.await?;