This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Synapse doesn't remove text search vectors for redacted messages #13122
Labels
A-Message-Search
Searching messages
S-Minor
Blocks non-critical functionality, workarounds exist.
T-Defect
Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Description
When a message event is sent in an unencrypted room, a text search vector of the message's content is written to the table
event_search
, so that the message will appear in future search results.If the message event is later redacted however, then synapse will remove the event's content from the table
event_json
in the database after a time period (given byredaction_retention_period
inhomeserver.yaml
, defaulting to 7 days as far as I understand). However, synapse does not appear to remove or clear the associated text search entry in theevent_search
table.Steps to reproduce
redaction_retention_period
event_json
event_search
corresponding to your redacted message event. Confirm thatvector
still contains information from the original messageHomeserver
Local Instance
Synapse Version
1.61.0
Installation Method
pip (from PyPI)
Platform
Raspberry Pi 4 Model B running Raspberry Pi OS bullseye from 2022-01-28
Relevant log output
Anything else that would be useful to know?
Despite text search vectors appearing to persist in the database past message redaction, the redacted message is not returned in search results. However, the approximate number of results displayed does account for the persistent search vector:

Search results for a room where a message containing the string
uniquestringvalue14
was sent and then redacted roughly 7 days ago. No search results are returned, but the number of results found is displayed as(~1 result)
.I have only tested this with a PostgreSQL database. If memory serves correctly however, then a relevant text search entry in an SQLite database will likely contain the full text content of a redacted message.
The text was updated successfully, but these errors were encountered: