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

Failed validating m.push_rules event #348

Closed
wavexx opened this issue Sep 18, 2022 · 4 comments · Fixed by #350
Closed

Failed validating m.push_rules event #348

wavexx opened this issue Sep 18, 2022 · 4 comments · Fixed by #350

Comments

@wavexx
Copy link
Contributor

wavexx commented Sep 18, 2022

I'm seeing the current message when using weechat-matrix and the current master of matrix-nio:

23:42 nio.events: Error validating event: 'default' is a required property
23:42
23:42 Failed validating 'required' in schema:
23:42     {'properties': {'actions': {'items': {'type': ['string', 'object']},
23:42                                 'type': 'array'},
23:42                     'conditions': {'items': {'properties': {'is': {'pattern': '(==|<=|>=|<|>)?[0-9.-]+',
23:42                                                                    'type': 'string'},
23:42                                                             'key': {'type': 'string'},
23:42                                                             'kind': {'type': 'string'},
23:42                                                             'pattern': {'type': 'string'}},
23:42                                              'required': ['kind'],
23:42                                              'type': 'object'},
23:42                                    'type': 'array'},
23:42                     'default': {'type': 'boolean'},
23:42                     'enabled': {'type': 'boolean'},
23:42                     'pattern': {'type': 'string'},
23:42                     'rule_id': {'type': 'string'}},
23:42      'required': ['rule_id', 'default', 'enabled', 'actions'],
23:42      'type': 'object'}
23:42
23:42 On instance:
23:42     {'actions': ['dont_notify'],
23:42      'enabled': True,
23:42      'rule_id': '!<room>:matrix.org'}
@wavexx
Copy link
Contributor Author

wavexx commented Sep 19, 2022

I debugged this a bit and it looks like this an issue in the generated json response from the official matrix servers when receiving room push_rules.

I've currently worked this around by patching nio/schemas.py, but I'm unsure whether fixing matrix-nio would be the appropriate action.

@wavexx wavexx changed the title Failed validating event Failed validating m.push_rules event Sep 19, 2022
@poljar
Copy link
Collaborator

poljar commented Sep 20, 2022

I think there's no other way than relaxing the schema.

@wavexx
Copy link
Contributor Author

wavexx commented Sep 20, 2022

Do we want to wait for a response from the synapse devs?
Otherwise I currently simply "default" to False, I could push a PR.

@poljar
Copy link
Collaborator

poljar commented Sep 20, 2022

No need I would say. A PR would be nice.

wavexx added a commit to wavexx/matrix-nio that referenced this issue Sep 20, 2022
poljar pushed a commit that referenced this issue Sep 20, 2022
DrRac27 pushed a commit to DrRac27/matrix-nio that referenced this issue Jul 18, 2023
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