Implement MSC3389: Relation redactions tests - #913
Merged
Merged
Conversation
Signed-off-by: bxdxnn <267911624+bxdxnn@users.noreply.github.com>
reivilibre
approved these changes
Sep 8, 2026
| ) | ||
|
|
||
| // The room version that enables MSC3389 ("Redaction changes for events with a relation"). | ||
| const msc3389RoomVersion = "org.matrix.msc3389.10" |
Contributor
There was a problem hiding this comment.
This isn't actually mentioned in the MSC, but I guess it's OK for the time being.
gamesguru
reviewed
Oct 1, 2026
| // Verify the original event is fully intact before redaction. | ||
| eventJsonBefore := alice.MustGetEvent(t, roomID, reactionID) | ||
| must.MatchGJSON(t, eventJsonBefore, | ||
| match.JSONKeyEqual("content.m.relates_to.rel_type", "m.annotation"), |
There was a problem hiding this comment.
These need the m.* escaped to prevent it being a path separator, e.g., match.JSONKeyEqual("content.m\\.relates_to.rel_type", "m.annotation").
Summarized by gpt-5.6 luna low:
A path separator is the dot GJSON uses to move through nested JSON objects.
For example:
content.m.relates_to.rel_type
means:
{
"content": {
"m": {
"relates_to": {
"rel_type": "..."
}
}
}
}But Matrix actually uses a literal key named m.relates_to:
{
"content": {
"m.relates_to": {
"rel_type": "..."
}
}
}So the dot must be escaped:
content.m\.relates_to.rel_type
That tells GJSON to treat m.relates_to as one key.
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement MSC3389 tests.
Pull Request Checklist