Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
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

Closed

Description

@Karlinde

Description

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.

Version information

  • Homeserver: private, not federating
  • Platform: Docker in Ubuntu running on a VPS.

Activity

  1. Karlinde commented on Jan 6, 2020

    @Karlinde
    ContributorAuthor

    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"] = False for each rule in _load_rules().

    PR submitted: #6639

  2. added
    z-bug(Deprecated Label)
    A-Spec-Complianceplaces where synapse does not conform to the spec
    z-p2(Deprecated Label)
    on Jan 14, 2020
  3. jplatte commented on May 22, 2020

    @jplatte
    Contributor

    Fixed in #6639?

  4. clokep commented on May 22, 2020

    @clokep
    Member

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Spec-Complianceplaces where synapse does not conform to the specz-bug(Deprecated Label)z-p2(Deprecated Label)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions