From e0d18ad733ff2b603ff71a7a5b62da0cbd8ca58d Mon Sep 17 00:00:00 2001 From: benkuly <12199167+benkuly@users.noreply.github.com> Date: Thu, 3 Nov 2022 17:46:37 +0100 Subject: [PATCH 1/4] init m.replace aggregation with full event Signed-off-by: benkuly --- proposals/tmp.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 proposals/tmp.md diff --git a/proposals/tmp.md b/proposals/tmp.md new file mode 100644 index 00000000000..34a881a6160 --- /dev/null +++ b/proposals/tmp.md @@ -0,0 +1,38 @@ +# MSC0000: m.replace aggregation with full event + +The Matrix DAG has immutable PDUs forming an auth chain. The client representation of this PDUs are simply called events. +While this events also have been immutable until v1.3, since v1.4 they aren't. +When a client sends a `m.replace` relation, [the server should replace the content of the original event](https://spec.matrix.org/v1.4/client-server-api/#server-side-replacement-of-content). + +There are some issues with this requirment: +* Changing the fundamental concept of immutable events is confusing. The server can response different event contents for the same `event_id`. +* If an event with `m.replace` relation is deleted, the client would need to detect, if the content was replaced and possibly needs to fetch the original event. +* There is an additional server call needed, when the replacing event is encrypted, because the server cannot replace the original event content. +* There are also some other issues with this spec paragraph, which are discussed [here](https://github.com/matrix-org/matrix-spec/issues/1299) + +## Proposal + +Instead of replacing the original content of an event, servers should use the aggregation feature for it. +In fact it is [already used](https://spec.matrix.org/v1.4/client-server-api/#server-side-aggregation-of-mreplace-relationships), +but only `event_id`, `origin_server_ts` and `sender` are included. +Theoretically this is enough to get the replacing content, but when the event with the `event_id` cannot be found locally it needs to be fetched from the server. +To prevent this additional call to the server, the `m.replace` aggregation should just contain the complete replacing event. + +The additional server call is already needed for encrypted events and would be saved by this proposal too. + +## Potential issues + +* There could be clients, which rely on the current behavior. +* It is not as easy for clients like as in the current spec to get the current content of an event by just looking into `content.body`. While this true, it is also a relatively inconsistent behavior. Future replacements of the event would be rendered as "* new content". So the event with the replaced event does look different (without "*") despite the fact, that it is also replaced. + +## Alternatives + + + +## Security considerations + + + +## Unstable prefix + +I'm not sure, if we need an unsable prefix, because the aggregation would just be extended by additional fields. From a59e2c3fafcc44069dd5bc3ea45d738211c560b5 Mon Sep 17 00:00:00 2001 From: benkuly <12199167+benkuly@users.noreply.github.com> Date: Thu, 3 Nov 2022 17:49:06 +0100 Subject: [PATCH 2/4] Rename tmp.md to 3925-replace-aggregation-with-full-event.md Signed-off-by: benkuly --- proposals/{tmp.md => 3925-replace-aggregation-with-full-event.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename proposals/{tmp.md => 3925-replace-aggregation-with-full-event.md} (100%) diff --git a/proposals/tmp.md b/proposals/3925-replace-aggregation-with-full-event.md similarity index 100% rename from proposals/tmp.md rename to proposals/3925-replace-aggregation-with-full-event.md From 099dad09028956f7cad57b6cb1ad20aa506f55e6 Mon Sep 17 00:00:00 2001 From: benkuly <12199167+benkuly@users.noreply.github.com> Date: Thu, 3 Nov 2022 17:52:24 +0100 Subject: [PATCH 3/4] Update 3925-replace-aggregation-with-full-event.md typos Signed-off-by: benkuly --- proposals/3925-replace-aggregation-with-full-event.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proposals/3925-replace-aggregation-with-full-event.md b/proposals/3925-replace-aggregation-with-full-event.md index 34a881a6160..d54669dd3ff 100644 --- a/proposals/3925-replace-aggregation-with-full-event.md +++ b/proposals/3925-replace-aggregation-with-full-event.md @@ -4,9 +4,9 @@ The Matrix DAG has immutable PDUs forming an auth chain. The client representati While this events also have been immutable until v1.3, since v1.4 they aren't. When a client sends a `m.replace` relation, [the server should replace the content of the original event](https://spec.matrix.org/v1.4/client-server-api/#server-side-replacement-of-content). -There are some issues with this requirment: -* Changing the fundamental concept of immutable events is confusing. The server can response different event contents for the same `event_id`. -* If an event with `m.replace` relation is deleted, the client would need to detect, if the content was replaced and possibly needs to fetch the original event. +There are some issues with this requirement: +* Changing the fundamental concept of immutable events is confusing. The server can respond with different event contents for the same `event_id`. +* If an event with `m.replace` relation is deleted, the client would need to detect, if the original content was replaced and possibly needs to fetch the original content. * There is an additional server call needed, when the replacing event is encrypted, because the server cannot replace the original event content. * There are also some other issues with this spec paragraph, which are discussed [here](https://github.com/matrix-org/matrix-spec/issues/1299) From d7e89fa38d0709f37141a01639a6b257ab550544 Mon Sep 17 00:00:00 2001 From: benkuly <12199167+benkuly@users.noreply.github.com> Date: Thu, 3 Nov 2022 17:55:26 +0100 Subject: [PATCH 4/4] Update 3925-replace-aggregation-with-full-event.md added MSC number Signed-off-by: benkuly --- proposals/3925-replace-aggregation-with-full-event.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/3925-replace-aggregation-with-full-event.md b/proposals/3925-replace-aggregation-with-full-event.md index d54669dd3ff..66e3910bee1 100644 --- a/proposals/3925-replace-aggregation-with-full-event.md +++ b/proposals/3925-replace-aggregation-with-full-event.md @@ -1,4 +1,4 @@ -# MSC0000: m.replace aggregation with full event +# MSC3925: m.replace aggregation with full event The Matrix DAG has immutable PDUs forming an auth chain. The client representation of this PDUs are simply called events. While this events also have been immutable until v1.3, since v1.4 they aren't.