matrix-org / matrix-org/matrix-spec

Should v3+ room version events containing an `event_id` field be rejected?

Open
#2,027 6 comments 0 reactions 0 assignees View on GitHub
clarification
Dominant language
HTML
Stars
330
Forks
150
Avg merge
2h 21m
Merged PRs (30d)
3

Description

**Link to problem area**: https://spec.matrix.org/v1.12/rooms/v3/#event-format

**Issue**

We received [this pull request](https://github.com/element-hq/synapse/pull/17893/) to Synapse which ignores incoming room v3+ events over federation if they contain an `event_id` field. The rationale being that events in rooms with room version v3+ have their event ID [derived](https://spec.matrix.org/v1.12/rooms/v3/#event-ids) from the non-redactable contents of the event.

Given that the `event_id` field in such an event would thus be fed into that hashing algorithm, in order to generate itself, this event structure appears improbable. In addition, if such a field exists in the event, it's likely that in practice the sending homeserver is accidentally sending an event constructed for a room v1/v2 room, instead of the v3+ room it's intended to be placed in.

Should the spec clarify that an event received with an `event_id` field already included, destined for a v3+ room, should thus not be accepted by the receiving homeserver?

Contributor guide

Open the contributing guide

Research direction

Start with the room v3 event format and event ID sections linked in the issue, then review Synapse pull request #17893 for the behavior under discussion. Determine whether the specification should require rejecting v3+ events containing event_id; done means the decision is resolved and the relevant normative text is clarified if needed.

Written by the indexing model from the issue text.

Assessment

Domain
backend-api-design, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.