Skip to content
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

Requirement of via attribute for m.space.parent and m.space.child events #433

Closed
timegrid opened this issue Aug 7, 2023 · 4 comments · Fixed by #434
Closed

Requirement of via attribute for m.space.parent and m.space.child events #433

timegrid opened this issue Aug 7, 2023 · 4 comments · Fixed by #434

Comments

@timegrid
Copy link

timegrid commented Aug 7, 2023

According to the matrix specs for space child/parent events, the via attribute can be omitted:

  • m.space.parent: When not present or invalid, the room is not considered to be part of the parent space
  • m.space.child: When not present or invalid, the child room is not considered to be part of the space

The schema implementation defines it as required though. I just tested the new version 0.21.2 against moment and got one related error message:

Error validating event: 'via' is a required property

Failed validating 'required' in schema['properties']['content']:
    {'properties': {'order': {'type': 'string'},
                    'suggested': {'default': False, 'type': 'boolean'},
                    'via': {'items': {'type': 'string'}, 'type': 'array'}},
     'required': ['via'],
     'type': 'object'}

On instance['content']:
    {'suggested': False}

Is there any reason, why via is required?

@PaarthShah
Copy link
Collaborator

PaarthShah commented Aug 18, 2023

@timegrid Hmm, I guess it's a matter of semantics.
The spec doesn't actually say that it's optional (which it does say for several other fields), which is a bit weird that it then goes to say that it might not be present.

I'm tempted to say that if you're running into this problem in your client, that probably means you might want to ensure that via is set at least to [] rather than leaving it empty... but if you know of any other clients that produce such events/behavior, then I'd actually be tempted to make an MSC to get this clarified... and I think that'd be a compelling case for relaxing this restriction

@PaarthShah
Copy link
Collaborator

I'll also quote MSC 1772 (the original spaces spec): https://github.com/matrix-org/matrix-spec-proposals/pull/1772/files#

The admins of a space can advertise rooms and subspaces for their space by
setting m.space.child state events. The state_key is the ID of a child
room or space, and the content must contain a via key which gives a list
of candidate servers that can be used to join the room.

Similar to m.space.child, the state_key is the ID of the parent space,
and the content must contain a via key which gives a list of candidate
servers that can be used to join the parent.

@PaarthShah
Copy link
Collaborator

Todo: this needs to be reverted to be compliant with: matrix-org/matrix-spec#1618

@timegrid
Copy link
Author

timegrid commented Feb 3, 2024

Thanks for the clarification. Just a remark: moment itself has not implemented spaces yet. The error message above was triggered by some event of another client "out there in the wild", so I assume, this might become a problem again. In that case I'll report back and we can evaluate, if that error should be better handled by all clients or nio itself.

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 a pull request may close this issue.

2 participants