element-hq / element-hq/synapse

Synapse omits `unsigned.membership` property on events served as part of a relationship aggregation

Open
#17,487 1 comment 0 reactions 0 assignees View on GitHub
A-E2EE A-Spec-Compliance A-User-Experience T-Enhancement
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

The spec describes an [`unsigned.membership`](https://spec.matrix.org/v1.11/client-server-api/#definition-clientevent_unsigneddata) property, which SHOULD be populated for all events. (Added by MSC4115.)

It also describes an [`unsigned.[m.relations]`](https://spec.matrix.org/v1.11/client-server-api/#aggregations-of-child-events) property which aggregates relationships on the relevant event. The aggregation format for [edits](https://spec.matrix.org/v1.11/client-server-api/#server-side-aggregation-of-mreplace-relationships) and thread [threads](https://spec.matrix.org/v1.11/client-server-api/#server-side-aggregation-of-mthread-relationships) both contain another event.

Synapse does not populate the `unsigned.membership` property for events served as part of such an aggregation.

This applies to at least `/event`, `/context`, `/relations` and `/sync`. (Note that `/event` also omits it on the *top-level* event: https://github.com/element-hq/synapse/issues/17486.)

For example, if `/sync` returns an event which has been edited, I expect a response like this, but, in practice, the `membership` property on the inner event is absent:

```json5
{
"type": "m.room.message",
"sender": "@a:xps9320.sw1v.org",
"content": { "msgtype": "m.text", "body": "def", "m.mentions": {} },
"origin_server_ts": 1721927656960,
"unsigned": {
"membership": "join",
"age": 1058542,
"m.relations": {
"m.replace": {
"type": "m.room.message",
"room_id": "!ScJmwYjNJCpEMjYXxe:xps9320.sw1v.org",
"sender": "@a:xps9320.sw1v.org",
"content": {
"msgtype": "m.text", "body": " * defg",
"m.new_content": { "msgtype": "m.text", "body": "defg", "m.mentions": {}},
"m.mentions": {},
"m.relates_to": { "rel_type": "m.replace", "event_id": "$Gpy6Cs5oGKtUWeJ3OsFeDtTeAKkOYN2zzTlpbCNcy1E" }
},
"origin_server_ts": 1721927685762,
"unsigned": {
// THIS PROPERTY IS OMITTED!
"membership": "join",
"age": 1029740
},
"event_id": "$AJk4WFjN2Jw2-Z0FM0HyBRcFnhhY-z4UXMjjpOke_Wo"
}
}
},
"event_id": "$Gpy6Cs5oGKtUWeJ3OsFeDtTeAKkOYN2zzTlpbCNcy1E"
}
```

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.