Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Feb 28, 2023
1 parent 3ec3737 commit 97b7544
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion changelogs/client_server/newsfragments/1440.feature
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Changes to the server-side aggregation of `m.replace` (edit) events, per [MSC3925](https://github.com/matrix-org/matrix-spec-proposals/pull/3925).
Changes to the server-side aggregation of `m.replace` (edit) events, as per [MSC3925](https://github.com/matrix-org/matrix-spec-proposals/pull/3925).
26 changes: 15 additions & 11 deletions content/client-server-api/modules/event_replacements.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,14 @@ replacement event.

##### Server-side aggregation of `m.replace` relationships

{{< changed-in v="1.7" >}}

Note that there can be multiple events with an `m.replace` relationship to a
given event (for example, if an event is edited multiple times). These should
be [aggregated](#aggregations) by the homeserver.

The aggregation format of `m.replace` relationships gives the **most recent**
replacement event, formatted as normal for the client-server API (see [Room Event Format](#room-event-format)).
replacement event, formatted as normal (see [Room Event Format](#room-event-format)).

The most recent event is determined by comparing `origin_server_ts`; if two or
more replacement events have identical `origin_server_ts`, the event with the
Expand Down Expand Up @@ -237,21 +239,23 @@ event that is the target of an `m.replace` relationship. For example:
}
```

If the original event is
[redacted](#redactions), any
If the original event is [redacted](#redactions), any
`m.replace` relationship should **not** be bundled with it (whether or not any
subsequent replacements are themselves redacted). Note that this behaviour is
specific to the `m.replace` relationship. See also [redactions of edited
events](#redactions-of-edited-events) below.

{{< changed-in v="1.7" >}} In previous versions of the specification, only the
`event_id`, `origin_server_ts`, and `sender` of the replacement event were included
in the aggregation. v1.7 extends the aggregation to the full event.

{{< changed-in v="1.7" >}} In previous versions of the specification, servers
were expected to replace the content of the original event with that of the
replacement event. However that behaviour made reliable client-side
implementation difficult, and servers should no longer make this replacement.
**Note:** the `content` of the original event is left intact. In particular servers
should **not** replace the content with that of the replacement event.

{{ boxes/rationale }}
In previous versions of the specification, servers were expected to replace the
content of an edited event whenever it was served to clients (with the
exception of the
[`GET /_matrix/client/v3/rooms/{roomId}/event/{eventId}`](#get_matrixclientv3roomsroomideventeventid)
endpoint). However, that behaviour made reliable client-side implementation
difficult, and servers should no longer make this replacement.
{{ /boxes/rationale }}

#### Client behaviour

Expand Down

0 comments on commit 97b7544

Please sign in to comment.