Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent redacted events from appearing in message search #6377

Merged
merged 3 commits into from Dec 11, 2019

Conversation

@anoadragon453
Copy link
Member

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.

@anoadragon453 anoadragon453 self-assigned this Nov 19, 2019
@anoadragon453 anoadragon453 added this to In progress in Homeserver Task Board via automation Nov 19, 2019
@anoadragon453 anoadragon453 moved this from In progress to Review in Homeserver Task Board Nov 19, 2019
@anoadragon453 anoadragon453 requested a review from matrix-org/synapse-core Nov 19, 2019
@anoadragon453 anoadragon453 force-pushed the anoa/search_redacted_events branch from 985ba7f to 916e71b Dec 2, 2019
@anoadragon453 anoadragon453 requested a review from richvdh Dec 2, 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.

This comment has been minimized.

Copy link
@richvdh

richvdh Dec 4, 2019

Member

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?)

This comment has been minimized.

Copy link
@anoadragon453

anoadragon453 Dec 5, 2019

Author Member

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
@anoadragon453 anoadragon453 removed this from Review in Homeserver Task Board Dec 5, 2019
@anoadragon453 anoadragon453 requested a review from richvdh Dec 5, 2019
@richvdh
richvdh approved these changes Dec 5, 2019
Copy link
Member

richvdh left a comment

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
22 checks passed
22 checks passed
buildkite/synapse Build #6075 passed (36 minutes, 27 seconds)
Details
buildkite/synapse/check-sample-config Passed (1 minute, 21 seconds)
Details
buildkite/synapse/check-style Passed (2 minutes, 12 seconds)
Details
buildkite/synapse/isort Passed (17 seconds)
Details
buildkite/synapse/mypy Passed (22 seconds)
Details
buildkite/synapse/newspaper-newsfile Passed (17 seconds)
Details
buildkite/synapse/packaging Passed (27 seconds)
Details
buildkite/synapse/pipeline Passed (5 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-postgres-9-dot-5 Passed (18 minutes, 49 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite Passed (6 minutes, 36 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite-slash-old-deps Passed (8 minutes, 57 seconds)
Details
buildkite/synapse/python-3-dot-6-slash-sqlite Passed (7 minutes, 8 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-11 Passed (19 minutes, 4 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-9-dot-5 Passed (18 minutes, 25 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-sqlite Passed (6 minutes, 42 seconds)
Details
buildkite/synapse/synapse-port-db-slash-python-3-dot-5-slash-postgres-9-dot-5 Passed (1 minute, 44 seconds)
Details
buildkite/synapse/synapse-port-db-slash-python-3-dot-7-slash-postgres-11 Passed (1 minute, 51 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-postgres-9-dot-6-slash-monolith Passed (13 minutes, 14 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-postgres-9-dot-6-slash-workers Passed (14 minutes, 26 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-sqlite-slash-monolith Passed (10 minutes, 53 seconds)
Details
buildkite/synapse/sytest-python-3-dot-7-slash-postgres-11-slash-monolith Passed (12 minutes, 14 seconds)
Details
buildkite/synapse/sytest-python-3-dot-7-slash-postgres-11-slash-workers Passed (12 minutes, 30 seconds)
Details
@anoadragon453 anoadragon453 deleted the anoa/search_redacted_events branch Dec 11, 2019
@anoadragon453

This comment has been minimized.

Copy link
Member Author

anoadragon453 commented Dec 11, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.