-
Notifications
You must be signed in to change notification settings - Fork 54
🐟 breaks join rules #450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It's not as simple as failing to unmarshal - https://go.dev/play/p/v-9Cl3v7mdU unmarshals just fine. When used as part of an event, the JSON is canonicalised, which has historically has issues with non UTF-8 characters, so potentially that? Without an error message it's hard to debug. |
This actually looks tricker than I first realised. Upon further inspection, I cannot actually repro with a fresh room with just the join rule I sent above, nor with some other tricks. After taking a stab at some of the auth event IDs in the relevant logs (attached) it looks like my fish may be in another castle. The room dendrite was struggling to join had some events sent by a user ID with UTF-8 characters in their user ID, and it looks like they've managed to end up in the auth chain (also attached). If you need any of the events included in the log, let me know (or ping me on Matrix) and I'll happily supply them. |
Can confirm this is actually more likely caused by a user with an invalid user ID sending an auth event used to join, which gmsl consequently cannot parse, failing:
The state for this room is also attached. I'm aware that this is just a case of "problem exists between chair and computer", but this does carry the capacity to accidentally brick a room in the eyes of Dendrite servers accidentally (the room I bricked with this was also entirely accidentally, I knew gmsl didn't handle UTF-8 very well but it never crossed my mind that it'd affect the auth chain) |
"allow": "🐟"
breaks the join rules in dendrite, and presumably this is caused by GMSL.Take for example
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 theJoinRuleEventContent.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 thejoin_rule
isrestricted
orknock_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 forstring
being used.The text was updated successfully, but these errors were encountered: