question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`/sync` response's `account_data` includes an `m.push_rules` event which doesn't include required `room.default` attribute

See original GitHub issue

Description

Using a current version matrix-nio on the default matrix.org homeserver I experience the following: https://github.com/poljar/matrix-nio/issues/348

The request: https://matrix.org/_matrix/client/r0/sync?access_token=<snip>&since=s3281165653_757284974_12692804_1597914399_1620552403_3573198_592315752_5209106983_0&full_state=true&timeout=0&filter=%7B%22room%22%3A%7B%22timeline%22%3A%7B%22limit%22%3A30%7D%2C%22state%22%3A%7B%22lazy_load_members%22%3Atrue%7D%7D%7D'

produces the following json:

{
  "next_batch": "s3281181518_757284974_12713739_1597925487_1620566333_3573208_592321297_5209124871_0",
  "account_data": {
    "events": [
      {
        "type": "m.push_rules",
        "content": {
          "global": {
            "room": [
              {
                "actions": [
                  "dont_notify"
                ],
                "rule_id": "!<roomid>:matrix.org",
                "enabled": true
              }
            ],

According to https://matrix.org/docs/api/#get-/_matrix/client/v3/pushrules/ the room.default parameter is required, but is not included in the “room” data.

Steps to reproduce

  • After a login request, perform a /sync request like the folling https://matrix.org/_matrix/client/r0/sync?access_token=<snip>&since=s3281165653_757284974_12692804_1597914399_1620552403_3573198_592315752_5209106983_0&full_state=true&timeout=0&filter=%7B%22room%22%3A%7B%22timeline%22%3A%7B%22limit%22%3A30%7D%2C%22state%22%3A%7B%22lazy_load_members%22%3Atrue%7D%7D%7D'
  • Note that the “default” parameter is not included in the “room” push_rules

Homeserver

matrix.org

Synapse Version

{“server”:{“name”:“Synapse”,“version”:“1.67.0 (b=matrix-org-hotfixes,3a5edde170)”}}

Installation Method

No response

Platform

n/a

Relevant log output

n/a

Anything else that would be useful to know?

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
richvdhcommented, Sep 23, 2022

It would be nicer to have it fixed either in the spec or in synapse, so that we don’t have to carry a patch.

I don’t think this was a deliberate change; it should be fixed in synapse rather than the spec.

0reactions
nico-famedlycommented, Sep 23, 2022

This issue breaks our SDK, which uses the openapi spec to generate the pushrule classes (where this is marked as required). This means when using custom push rules, we can’t process push rules properly anymore nor can we properly modify them anymore. While we can work around this by patching the openapi spec before generating our code, this means that some of our deployments are currently experiencing this regression and can’t use their custom pushrules anymore via our clients. It would be nicer to have it fixed either in the spec or in synapse, so that we don’t have to carry a patch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Client-Server API - Matrix.org
The client-server API provides a simple lightweight API to let clients send messages, control rooms and synchronise conversation history. It is designed to ......
Read more >
sync.js - Documentation
It may not be safe to remove events if * there are other references to the timelines for this room. * Default: returns...
Read more >
API — nio 0.18.7 documentation - Read the Docs
Returns the HTTP method, HTTP path and data for the request. Parameters: access_token (str) – The access token to be used with the...
Read more >
Azure AD Connect sync: Understanding the default configuration
Ensure user objects with no sAMAccountName attribute are not synchronized. This case would only practically happen in a domain upgraded from ...
Read more >
dendrite/sytest-whitelist at main · matrix-org/dendrite - GitHub
Real non-joined user cannot call /events on default room ... Newly joined room is included in an incremental sync. User is ... Can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found