You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
"default" field in PushRule omitted for user-defined push rules #6636
The spec states that for push rules returned from the server, the field default is required. Synapse however seems to omit this field for user-defined rules, leading to deserialization failures for a spec-compliant client that expects it when fetching push rules.
Steps to reproduce
Push a user-defined push rule to synapse using PUT /_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId}.
Fetch all push rules using GET /_matrix/client/r0/pushrules/.
Find the newly created rule in the returned ruleset. It doesn't have a default field.
Since the spec states that the default field is required, I did not expect the server to be allowed to omit it.
Activity
Karlinde commentedon Jan 6, 2020
Looking at the code, it looks like the issue is that only the built-in rule objects ever get the "default" key set, which seems to happen here.
A simple solution would be to just add
rule["default"] = Falsefor each rule in_load_rules().PR submitted: #6639
jplatte commentedon May 22, 2020
Fixed in #6639?
clokep commentedon May 22, 2020
Looks like we never closed this after merging the PR. I'm going to close this, but let us know if there's more to do here!