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

MSC3989: Redact origin property on events #3989

Merged
merged 7 commits into from
Jun 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions proposals/3989-redact-origin-field.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# MSC3989: Redact `origin` property on events

The [current redaction algorithm](https://spec.matrix.org/v1.6/rooms/v10/#redactions) *keeps* the
top-level `origin` property on events during redaction, however, as of this writing, the only use within the
spec of `origin` as a top-level event property is a malformed example of event format. The property has no
significant meaning in modern room versions.

Within the ecosystem, it's clear that we'd [prefer the property to disappear](https://github.com/matrix-org/matrix-spec/issues/374),
and have [tried to do so](https://github.com/matrix-org/matrix-spec/pull/998) in the past. The
malformed examples are even [known to us](https://github.com/matrix-org/matrix-spec/issues/1480).

What's not clear, and mentioned in [a comment](https://github.com/matrix-org/matrix-spec/issues/1480#issuecomment-1495183789),
is whether the `origin` property is *actually* used. There do not appear to be any auth rules or similar
which would use the property, however it'd hardly be the first time that the spec was wrong about an
ancient room version like v1. What is clear is that Synapse, where this question would be asked,
wants to [drop support](https://github.com/matrix-org/synapse/issues/3816) for the property and has
taken [steps](https://github.com/matrix-org/synapse/pull/8324) towards that mission by fixing bugs
in the area. In a [quick audit](https://github.com/matrix-org/matrix-spec-proposals/pull/3989#issuecomment-1497659507)
of the Synapse codebase during implementation of this MSC, the `origin` property appears unused.

Given the above context, this proposal removes the `origin` property from the [redaction algorithm](https://spec.matrix.org/v1.7/rooms/v10/#redactions)
in a future room version, leaving it as-is for existing versions (not that an MSC can change the behaviour
of an already-stable room version anyways).

Some other properties are additionally useless in modern room versions, however they are already adapted
by [MSC2176](https://github.com/matrix-org/matrix-spec-proposals/pull/2176).

## Proposal

In a future room version, the `origin` property is *removed* from the list of *event* keys which are
kept during redaction. Note that this requires a new room version because changing the redaction
algorithm changes how [event IDs](https://spec.matrix.org/v1.6/rooms/v10/#event-ids) are calculated,
as they are [reference hashes](https://spec.matrix.org/v1.6/server-server-api/#calculating-the-reference-hash-for-an-event)
which redact the event during calculation.

## Potential issues

No major concerns.

## Alternatives

No significant alternatives.

## Security considerations

No major concerns.

## Unstable prefix

While this MSC is not considered stable, implementations should use `org.matrix.msc3989` as the room
version identifier, using v10 as a base.

## Dependencies

No blocking dependencies.

This MSC would partner well with the following MSCs, however:
* [MSC2176](https://github.com/matrix-org/matrix-spec-proposals/pull/2176)
* [MSC2175](https://github.com/matrix-org/matrix-spec-proposals/pull/2175)
* [MSC2174](https://github.com/matrix-org/matrix-spec-proposals/pull/2174)
* [MSC3821](https://github.com/matrix-org/matrix-spec-proposals/pull/3821)