Skip to content

fix: MSC3389 relation JSON paths - #932

Merged
anoadragon453 merged 1 commit into
matrix-org:mainfrom
gamesguru:guru/upstream/fix/msc3389-dot-path-sep-gjson-glitch
Oct 7, 2026
Merged

anoadragon453 merged 1 commit into
matrix-org:mainfrom
gamesguru:guru/upstream/fix/msc3389-dot-path-sep-gjson-glitch

Conversation

@gamesguru

@gamesguru gamesguru commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Spawning from #913 (comment)

Didn't work for me. Kept failing. Found out, the test was wrong.


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.


Pull Request Checklist

Signed-off-by: Shane Jaroch <chown_tee@proton.me>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 10:20
@gamesguru
gamesguru requested review from a team as code owners October 1, 2026 10:20
@gamesguru
gamesguru requested review from anoadragon453 and removed request for a team October 1, 2026 10:20

@anoadragon453 anoadragon453 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for this!

@anoadragon453
anoadragon453 merged commit 78516f9 into matrix-org:main Oct 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants