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

[WIP] MSC4059: Mutable event content #4059

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

turt2live
Copy link
Member

@turt2live turt2live added requires-room-version An idea which will require a bump in room version proposal A matrix spec change proposal client-server Client-Server API unassigned-room-version Remove this label when things get versioned. kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. hacktoberfest-accepted labels Oct 14, 2023

**TODO**: Detail.

Just send edits, or regular state updates!?

Choose a reason for hiding this comment

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

Sending edits (deltas) seems like a good idea.
It may lower event's size substantially (given the difference between event's content and made changes is great, such as type corrections, which I'd expect to be the most used case).
E.g., original text: "The wolrd is round" , changes [del 6(l), del 7(r), add 5 r, add 6 r] or [cursor at 8 (r), del, del, r, l].
new text: "The world is round".
I.e., we could use a CRDT data model to represent edits.

What I like about this approach is how we have persistency. If you reply to one's event you want it to point to exact content you referred to. Later on this content may evolve, but the pointer is at that particular version in history.
Makes us safe from subversion of semantics.
E.g., one posted "I love petting cats!" and you reply "Me too, would do it all day long!". Later original poster could change it to "I love torturing cats!", but your semantics are not subverted, as it points to the exact snapshot that's about petting.

Choose a reason for hiding this comment

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

We would not need a full-fledged CRDT if a message is edited only from one device, having it as a simple log of edits. But given you have multiple devices there may inevitably be a case where you make edits from both. E.g., it's a darn long-form message one works on for a couple of days from both your laptop and mobile (while enjoing comfort of whatever one's sitting on).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-server Client-Server API hacktoberfest-accepted kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal requires-room-version An idea which will require a bump in room version unassigned-room-version Remove this label when things get versioned.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants