Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSC2540: Stricter event validation: JSON compliance #2540

Merged
merged 10 commits into from
May 25, 2020
14 changes: 11 additions & 3 deletions proposals/2540-stricter-event-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,26 @@ even support these by default. One common additional feature is handling

## Proposal
turt2live marked this conversation as resolved.
Show resolved Hide resolved

In a future room version, Matrix server implementations are to strictly enforce
the JSON compliance of the Canonical JSON specification for events.
In a future room version, homeserver implementations are to strictly enforce
the JSON compliance of the Canonical JSON specification for events. Events that
do not abide by these rules should be rejected with the error code `M_NOT_JSON`.
clokep marked this conversation as resolved.
Show resolved Hide resolved
clokep marked this conversation as resolved.
Show resolved Hide resolved

The rationale for doing this in a future room version is to avoid a split brain
room -- where some federated servers believe an event is valid and others reject
it as invalid. Rooms will be able to opt into this behavior as part of a room
version upgrade.

Homeserver implementations are not to strictly enforce this JSON compliance in
[stable room versions](https://matrix.org/docs/spec/#complete-list-of-room-versions).
clokep marked this conversation as resolved.
Show resolved Hide resolved
The rationale is essentially the same as why a future room version is necessary,
clokep marked this conversation as resolved.
Show resolved Hide resolved
this ensures that all federated servers treat the same events as valid.


## Potential issues

N/A
Homeserver implementations might include JSON parsers which are stricter than
others. It may not be worthwhile or reasonable to loosen those restrictions for
stable room versions.


## Alternatives
Expand Down