Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Prevent redacted events from appearing in message search #6377

Merged
merged 3 commits into from
Dec 11, 2019

Conversation

anoadragon453
Copy link
Member

@anoadragon453 anoadragon453 commented Nov 19, 2019

Fixes #1454

Removes an event from the event_search table upon redaction.

Associated sytest: matrix-org/sytest#747


Note: This PR is not a complete solution. #6522 should also be considered.

synapse/storage/data_stores/main/events_worker.py Outdated Show resolved Hide resolved
richvdh
richvdh previously requested changes Dec 4, 2019
synapse/storage/data_stores/main/events_worker.py Outdated Show resolved Hide resolved
synapse/storage/data_stores/main/events_worker.py Outdated Show resolved Hide resolved
include the previous states content in the unsigned field.
allow_rejected (bool): If True return rejected events.
allow_rejected: If True, return rejected events.
allow_redacted: If True, return redacted events.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you document the interaction between check_redacted and allow_redacted more clearly? What is the meaning of check_redacted if allow_redacted is False?

(maybe we should replace check_redacted with a tristate?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I've switched it out for an enum now, let me know what you think.

synapse/storage/data_stores/main/search.py Outdated Show resolved Hide resolved
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, though there's something wrong with the CI

…rch_redacted_events

* 'develop' of github.com:matrix-org/synapse: (100 commits)
  Move get_state methods into FederationHandler (#6503)
  Allow SAML username provider plugins (#6411)
  Fix race which caused deleted devices to reappear (#6514)
  Refactor get_events_from_store_or_dest to return a dict (#6501)
  Remove redundant code from event authorisation implementation. (#6502)
  Newsfile
  Silence mypy errors for files outside those specified
  Newsfile
  Phone home stats DB reporting should not assume a single DB.
  Update comment
  Drop unused index
  Convert _censor_redactions to async since it awaits on coroutines
  Only start censor background job after indices are created
  Newsfile
  Newsfile
  Fix make_deferred_yieldable to work with coroutines
  Newsfile
  Fix support for SQLite 3.7.
  Better errors regarding changing avatar_url (#6497)
  1.7.0rc1
  ...
@anoadragon453 anoadragon453 merged commit fc316a4 into develop Dec 11, 2019
@anoadragon453 anoadragon453 deleted the anoa/search_redacted_events branch December 11, 2019 13:39
@anoadragon453
Copy link
Member Author

Unfortunately it looks like this doesn't entirely fix the problem. Redacted events are still returned. The test wasn't correctly testing that a redacted event didn't appear in the results.

babolivier pushed a commit that referenced this pull request Sep 1, 2021
* commit 'fc316a489':
  Prevent redacted events from appearing in message search (#6377)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants