synapse icon indicating copy to clipboard operation
synapse copied to clipboard

Unspecced `redacted_by` field in `unsigned`

Open joepie91 opened this issue 5 years ago • 6 comments

Ran into the following event today:

{
	"content": {
		"membership": "join"
	},
	"origin_server_ts": 1595256121167,
	"sender": "@redacted_user_1:example.com",
	"state_key": "@redacted_user_1:example.com",
	"type": "m.room.member",
	"unsigned": {
		"redacted_by": "$redacted_id_1",
		"redacted_because": {
			"content": {},
			"origin_server_ts": 1595261803914,
			"redacts": "$redacted_id_2",
			"sender": "@redacted_user_2:example.com",
			"type": "m.room.redaction",
			"unsigned": {
				"age": 23764322
			},
			"event_id": "$redacted_id_1"
		}
	},
	"event_id": "$redacted_id_2"
}

This event contains a redacted_by property in the unsigned data, but the client-server spec makes no mention of such a field, it only mentions redacted_because.

joepie91 avatar Jul 20 '20 23:07 joepie91

as a general rule, the presence of a field in a response from synapse does not necessarily mean it should be added to the spec.

I'm more inclined to consider this a bug in synapse, though not a high priority one.

richvdh avatar Jul 21 '20 12:07 richvdh

Hm. I was interpreting this to be an intended (spec) feature, to reduce bandwidth usage by sending only the event ID rather than the whole event (as is the case for redacted_because) - hence filing it here first. But perhaps that wasn't the intention :)

joepie91 avatar Jul 21 '20 13:07 joepie91

(moved this issue from matrix-doc to synapse)

richvdh avatar Nov 16 '20 13:11 richvdh

I think this may be closed now as the spec now defines that field, see Redactions in v1.8

Zocker1999NET avatar Nov 28 '23 12:11 Zocker1999NET

That says:

Servers should include a copy of the m.room.redaction event under unsigned as redacted_because when serving the redacted event to clients.

Note the redacted_because instead of redacted_by, so I think there's some sort of inconsistency still?

clokep avatar Nov 28 '23 12:11 clokep

Note the redacted_because instead of redacted_by, so I think there's some sort of inconsistency still?

sorry, my bad, that was a read fault (while finding this issue, I was searching for redacted_because. I misread redacted_by for it in the title)

Zocker1999NET avatar Nov 30 '23 00:11 Zocker1999NET