matrix-rust-sdk icon indicating copy to clipboard operation
matrix-rust-sdk copied to clipboard

Redacting a room state event does not appear to redact the event in the local store

Open johannescpk opened this issue 1 year ago • 2 comments

Describe the bug I'm redacting a state event with JoinedRoom::redact(state_event_id) and the trace log shows that the following sync contains the redaction event. When I retrieve the original state event after that with JoinedRoom::get_state_event_static(state_event_id) I get the original event (enum variant), not the redacted one. @jplatte mentioned that it should already update the local store and redact the event there, similar to what synapse does. An alternative might be to re-fetch the redacted event from synapse.

To Reproduce Steps to reproduce the behavior:

  1. Send state event
  2. Redact with JoinedRoom::redact(state_event_id)
  3. Wait for sync
  4. Fetch state event again via JoinedRoom::get_state_event_static(state_event_id)

Expected behavior The state event should be the redacted enum variant of the event.

johannescpk avatar Jul 29 '22 13:07 johannescpk

@johannescpk I cannot confirm this problem here. Please check out the PR I've created, it contains two integration tests for this scenario, one with get_state_event and one using get_state_event_static - neither fails. Or am I doing something differently than what you are expecting/doing? Thanks for checking it out.

gnunicorn avatar Aug 04 '22 13:08 gnunicorn

Honestly the more interesting case to me seems like what happens if you use get_state_event[_static] without syncing with the server again.

jplatte avatar Aug 04 '22 13:08 jplatte