matrix-org / matrix-org/matrix-rust-sdk
SSS repeatedly re-sends subscriptions on every single /sync request.
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 500
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 106
Description
While debugging SSS in aurora (EWX test jig), I took a look at the requests in the network debugger. Each HTTP request body on the `room-list` connection looks like the below - with every single room which the user has most recently subscribed to via `roomListService.subscribe()` being included, with filter, on the every single long poll request.
This feels like a very significant waste of bandwidth and processing on the server (especially as clients don't typically compress the request body) - in this case an additional 10KB for every response. Surely we should only specify subscriptions when they change, rather than repeat the current new subscriptions on every request.
(See also https://github.com/element-hq/synapse/issues/18517 for another similarly large hunk of bandwidth being wasted in every sync response)
```json
{
"conn_id": "room-list",
"txn_id": "d3935ddc39754acb90e715d421ae2975",
"lists": {
"all_rooms": {
"ranges": [
[
0,
152
]
],
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""]
],
"timeline_limit": 1,
"filters": {
"not_room_types": [
"m.space"
]
}
}
},
"room_subscriptions": {
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
},
"!roomid:example.com": {
"required_state": [
["m.room.name", ""],
["m.room.encryption", ""],
["m.room.member", "$LAZY"],
["m.room.member", "$ME"],
["m.room.topic", ""],
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.tombstone", ""],
["m.room.create", ""],
["m.room.history_visibility", ""],
["io.element.functional_members", ""],
["m.room.pinned_events", ""]
],
"timeline_limit": 20
}
},
"extensions": {
"account_data": {
"enabled": true
},
"receipts": {
"enabled": true,
"rooms": [
"*"
]
},
"typing": {
"enabled": true
}
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.