matrix-org / matrix-org/gomatrixserverlib
๐ breaks join rules
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 67
- Forks
- 60
- PR merge metrics
- No merged PRs in 30d
Description
"allow": "๐" breaks the join rules in dendrite, and presumably this is caused by GMSL.
Take for example
{"allow": "๐", "join_rule": "knock"}
this m.room.join_rules event content.
From what I can gather, rather than ignoring the invalid allow field, GMSL is failing to unmarshal the event at all, causing the JoinRuleEventContent.JoinRule to be "", or an empty string, which is not allowed by spec, causing valid joins to fail.
The solution to this is to ignore the invalid allow value (unless the join_rule is restricted or knock_restricted, otherwise the event must always fail joins without an invite per the spec), however I dug into the code briefly myself and got a bit lost. It's entirely possible that it's not an unmarshal error that's being discarded but in fact just the join rule itself being entirely discarded and consequently not set, leading to the default for string being used.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up โ it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how GMSL unmarshals m.room.join_rules event content into JoinRuleEventContent.JoinRule, including handling of the invalid allow value. Confirm the behavior for the shown knock event and compare it with restricted and knock_restricted rules; done means invalid allow data no longer prevents valid join-rule handling and the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100