element-hq / element-hq/synapse

The `limit` set for a filter in a room's `StateFilter` is ignored

Open
#7,306 0 comments 0 reactions 0 assignees View on GitHub
A-Spec-Compliance A-Sync O-Uncommon S-Minor T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#7306](https://github.com/matrix-org/synapse/issues/7306).

---

### Description

I'm using the below filter in a `sync`:

```json
{
"room": {
"state": {
"types": [
"m.room.member",
"m.room.name"
],
"limit": 10
},
"timeline": {
"limit": 10
},
"ephemeral": {
"not_types": [ "*" ]
}
}
}
```

Please note that both room `state` and `timeline` limits are set to 10. In the resulting JSON I see my limit applied in timeline events (also `limited: true`), but not in room state events (one room in `join` has 4000+ events listed). According to the client-server [API docs](https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-client-r0-user-userid-filter) a `limit` clause should apply to `StateFilter`

### Steps to reproduce

- perform a `sync` without `since`
- include a filter in the query that requests `room.state.limit = 10`

The limit should apply in e.g. `rooms.join..state.events`, but it doesn't seem to do so.

- **Homeserver**: `mozilla.modular.im`

If not matrix.org:

- **Version**: `{"server_version": "1.12.3", "python_version": "3.7.7"}`

- **Install method**:

- **Platform**:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.