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

Change the server aggregation for edits #1440

Merged
merged 4 commits into from
Mar 21, 2023
Merged

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Feb 21, 2023

Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally lgtm - mostly nits about documentation style in this one.

Comment on lines 240 to 254
An exception applies to [`GET /_matrix/client/v3/rooms/{roomId}/event/{eventId}`](#get_matrixclientv3roomsroomideventeventid),
which should return the unmodified event (though the relationship should still
be bundled, as described above).
{{< 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as spec language is concerned, this should be something like:

{{< changed-in v="1.7" >}} Servers MUST NOT return the most recent edit from [/event].

{{ boxes/rationale }}
In previous versions...
{{ /boxes/rationale }}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{{< changed-in v="1.7" >}} Servers MUST NOT return the most recent edit from [/event].

this seems to say the opposite to what is intended.

I've moved the changed-in to the top of the section, which seems to be what we've done elsewhere, and moved this explanation into a "rationale" as you suggest.

content/client-server-api/modules/event_replacements.md Outdated Show resolved Hide resolved
@@ -211,16 +205,35 @@ event that is the target of an `m.replace` relationship. For example:
```json
{
"event_id": "$original_event_id",
// irrelevant fields not shown
"type": "m.room.message",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, I'm still very sad that #688 isn't a thing, which would ideally make this sort of example easy to update in the future.

Non-blocking for this review.

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
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)).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
replacement event, formatted as normal for the client-server API (see [Room Event Format](#room-event-format)).
replacement event. {{< changed-in v="1.7" >}} That event is formatted as normal for the client-server API (see [Room Event Format](#room-event-format)).

arguably we can also use less words because we're already in the CS API:

Suggested change
replacement event, formatted as normal for the client-server API (see [Room Event Format](#room-event-format)).
replacement event. {{< changed-in v="1.7" >}} That event is formatted [as normal](#room-event-format) for clients.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I've moved the changed-in to the top of the section I don't think this extra changed-in is helpful. I've applied the wording changes, with tweaks.

Comment on lines -137 to -138
Note that server implementations must not *actually* overwrite
the original event's `content`: instead the server presents it as being overwritten
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to stick the first part of this note somewhere still, just in case servers do super strange things with their events?

Possibly at the end of the server implementation section with a bit more detail?

{{% boxes/note %}}
Note that server implementations must not *actually* overwrite
the original event's `content`. Doing so would cause the original
event to fail signature checks.
{{% /boxes/note %}}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like it is more confusing than helpful. As a server implementer, I am led to wonder wtf this "actually" means.

I have added some more words to the "server-side aggregation" section which might help here (97b7544#diff-7791fd17e89af8337a50aaa7e5fdf6cb1c20013d38cd491cda852e696884be76R248).

changelogs/client_server/newsfragments/1440.feature Outdated Show resolved Hide resolved
@richvdh richvdh requested a review from turt2live February 28, 2023 14:40
@richvdh
Copy link
Member Author

richvdh commented Feb 28, 2023

@turt2live PTAL.

I also realised I'd left in some untruths in the "client behaviour section" - cf 05d1779

Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks :)

@richvdh richvdh merged commit acb631d into main Mar 21, 2023
@richvdh richvdh deleted the rav/replacement_aggregations branch March 21, 2023 15:59
clokep pushed a commit to clokep/matrix-spec that referenced this pull request May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistency for edits to encrypted events
2 participants