fix MSC3912-relation-based-redaction for room versions > 10#19782
fix MSC3912-relation-based-redaction for room versions > 10#19782jason-famedly wants to merge 7 commits into
Conversation
… 'redacts' key in v11)
anoadragon453
left a comment
There was a problem hiding this comment.
Sorry for the long delay on review. We're slowly getting through the backlog ⌛
anoadragon453
left a comment
There was a problem hiding this comment.
Just a couple small things. Otherwise this looks nearly good to go!
anoadragon453
left a comment
There was a problem hiding this comment.
I should've mentioned this earlier, but could you write a quick unit test or two to double-check that this does what we hope it does?
As part of the bring-up for defaulting to room version 12 work we are part of, this has been locally tested. Perhaps a parameterized or temporary commit that changes the room version for this whole block of tests? |
Room version 11 moved the
redactskey for redaction events from top-level to inside thecontentsobject of an Event. Incorporate the change needed to maintain this MSC remains operational.This fixes some MSC3912 behavior when used with room versions > 10.
Needed to pass room version 11 & 12 unit tests. 3 fail without this
Test results before
A bit more context:
By using the raw initial
EventBasefrom the original redaction request, this included theredactskey incontentsfor the original targeted event that needed redaction. This was not being changed or overwritten by the new redaction event that was being created to handle a related event, instead a new top-levelredactskey was produced pointing at the correct targeted event ID. After construction of theEventBasefor this new event(increate_and_send_nonmember_event()) the newEventBasesredactproperty first reads the key in thecontentobject and returns, which ignores the top-levelredacts. So this mechanism was trying to redact the wrong(and already redacted!) original event per the request.Pull Request Checklist
EventStoretoEventWorkerStore.".code blocks.