Skip to content

Commit b5b8110

Browse files
committed
Don't redact old megolm sessions
Old meaning received before message index tracking was implemented
1 parent efd1eaa commit b5b8110

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mautrix/crypto/store/asyncpg/store.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ async def redact_group_sessions(
319319
q = """
320320
UPDATE crypto_megolm_inbound_session
321321
SET withheld_code=$1, withheld_reason=$2, session=NULL, forwarding_chains=NULL
322-
WHERE (room_id=$3 OR $3='') AND (sender_key=$4 OR $4='') AND session IS NOT NULL AND account_id=$5 AND is_scheduled=false
322+
WHERE (room_id=$3 OR $3='') AND (sender_key=$4 OR $4='') AND account_id=$5
323+
AND session IS NOT NULL AND is_scheduled=false AND received_at IS NOT NULL
323324
RETURNING session_id
324325
"""
325326
rows = await self.db.fetch(

0 commit comments

Comments
 (0)