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

MSC1767: Extensible event types & fallback in Matrix (v2) #1767

Merged
merged 45 commits into from
Feb 6, 2023

Conversation

ara4n
Copy link
Member

@ara4n ara4n commented Jan 1, 2019

Rendered.

Obsoletes #1225

Shepherd: @turt2live


Implementations:

Proven by other MSC implementations as well (may be an older version of this MSC, but still compatible on a technical level):

Early conceptual work for extensible events usage:

Articles:


FCP tickyboxes

@ara4n ara4n changed the title first cut of MSC1767 for extensible events (replaces MSC1225) MSC1767: Extensible event types & fallback in Matrix (v2) Jan 1, 2019
@ara4n ara4n added proposal A matrix spec change proposal proposal-pr T-Core labels Jan 1, 2019
proposals/1767-extensible-events.md Outdated Show resolved Hide resolved
proposals/1767-extensible-events.md Show resolved Hide resolved
proposals/1767-extensible-events.md Outdated Show resolved Hide resolved
Copy link
Contributor

@non-Jedi non-Jedi left a comment

Choose a reason for hiding this comment

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

In general, I like this much better than previously. Still strongly believe we should have server-side permission control on event types in non-e2ee rooms.

proposals/1767-extensible-events.md Outdated Show resolved Hide resolved
proposals/1767-extensible-events.md Outdated Show resolved Hide resolved
proposals/1767-extensible-events.md Outdated Show resolved Hide resolved
proposals/1767-extensible-events.md Outdated Show resolved Hide resolved
proposals/1767-extensible-events.md Outdated Show resolved Hide resolved
@ara4n
Copy link
Member Author

ara4n commented Jan 8, 2019

@non-Jedi many thanks for cogitating on this and reviewing :)

@alphapapa
Copy link

I feel like this is much clearer and simpler than the previous Google doc version. At least, as a client dev, this doesn't scare me much. :) Thanks.

@florianjacob
Copy link
Contributor

I wonder what should happen if a custom state event is extended, e.g. with a text fallback? It could make sense to store the temperature example as state event, keyed by sensors / sensor location, and then the home automation system can directly query the current state and does not have to bother with syncing & filtering until the correct one is found. Still, as custom state events are invisible for normal clients, extending them with a non-state-events to associate a fallback or other one-off / change-related information could help, though that should probably not end up in the actual room state…

I guess “the whole thing is now a state event with all content as value” would also work out, though I think the semantics thould be specified in the MSC.

Example:

{
    "type": "net.arasphere.temperature",
    "state_key": "living_room",
    "content": {
        # one-off non-state events associated with the state change,
         # but not needed in the actual room state?
        "m.text": "The living room temperature rose by 1.5C. It is now 37C",
        "m.html": "The living room temperature rose by <font color='#f00'1.5C</font>. It is now <font color='#f00'>37C</font>",
        "net.arasphere.temperature.diff": {
            "temperature_rise": 1.5
        }
        # actual state event?
        "net.arasphere.temperature": {
            "temperature": 37.0
        }
    }
}

@mscbot
Copy link
Collaborator

mscbot commented Feb 5, 2023

The final comment period, with a disposition to merge, as per the review above, is now complete.

@mscbot mscbot added finished-final-comment-period and removed disposition-merge final-comment-period This MSC has entered a final comment period in interest to approval, postpone, or delete in 5 days. labels Feb 5, 2023
@turt2live turt2live merged commit fe8be28 into old_master Feb 6, 2023
@turt2live turt2live added spec-pr-missing Proposal has been implemented and is being used in the wild but hasn't yet been added to the spec blocked Something needs to be done before action can be taken on this PR/issue. and removed finished-final-comment-period labels Feb 6, 2023
@mscbot
Copy link
Collaborator

mscbot commented Feb 7, 2023

🔔 This is now entering its final comment period, as per the review above. 🔔

@mscbot mscbot added the final-comment-period This MSC has entered a final comment period in interest to approval, postpone, or delete in 5 days. label Feb 7, 2023
@turt2live turt2live removed the final-comment-period This MSC has entered a final comment period in interest to approval, postpone, or delete in 5 days. label Feb 7, 2023
@turt2live
Copy link
Member

(Someone ticked their box post-fcp, and the bot is confused: ignore it)

turt2live added a commit that referenced this pull request Feb 28, 2023
* first cut of MSC1767 for extensible events (replaces MSC1225)

* tabs->spaces

* fix markdown

* fix markdown

* GFM needs two spaces after ##?

* delta from msc1225

* 2021 refresh

* Refactor to be just text messaging + schema

* Update MSC numbers

* Touchups for FCP

* *ahem*

* Rewrite MSC to be understandable?

* Update proposals/1767-extensible-events.md

* Rewrite MSC, again

* Clarify Andy's blog state

* Relax m.markup's requirements

* Misc clarifications

* Revert "Relax m.markup's requirements"

This reverts commit 5f15b9f.

* Clarify push rules handling

* Fix example

* Update extensible events MSCs list

* Update Andy's blog post reference

* Update per review feedback

* Move emotes, notices, and encryption out to dedicated MSCs
* Clarify text throughout

* Cover all the bases

* Clarify mixins are exactly what they're assumed to be

* Clarify fallback and number of datums per event

* Fix description of plain text baseline

* Clarify SCT's role in feature scope & cut "mixed" events (not mixins)

* Fix description of mixins

* Update proposals/1767-extensible-events.md

Co-authored-by: David Baker <dbkr@users.noreply.github.com>

* Expand on how unknown events are handled

* Apply suggestions from code review

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Trim line length post-suggestions

* Mention that extensible events might appear in other room versions early

* Remove duplicated unknown parse order being an implementation detail

* Note difference between optional content blocks and mixins

* Apply suggestions from code review

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Update proposals/1767-extensible-events.md

Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>

* Clarify that clients are still strongly encouraged to validate HTML

* Fix mention of mixing legacy event types

* Update proposals/1767-extensible-events.md

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>

* Link to MSC3765

* Rename `m.markup` to `m.text`

---------

Co-authored-by: Travis Ralston <travpc@gmail.com>
Co-authored-by: Travis Ralston <travisr@matrix.org>
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Comment on lines +314 to +318
Another possible mixin would be `m.relates_to` (not described by this MSC). Currently,
some features like the [key verification framework](https://spec.matrix.org/v1.5/client-server-api/#key-verification-framework)
rely on relationships as part of making the feature work. The expectation is that
these features would be adapted to meet the "purely additive" condition (assuming
`m.relates_to` does actually end up being a mixin).
Copy link
Member

@anoadragon453 anoadragon453 Jul 13, 2023

Choose a reason for hiding this comment

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

What about reactions? Surely those can't function without a relation being present either.

Copy link
Member

Choose a reason for hiding this comment

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

yea... reactions are awkward. The relationship should be additive (without aggregation key), but representing the aggregation key as a content block is difficult. The expectation is that a dedicated MSC would solve extev reactions.

blocks and legacy fields, however that approach did not give sufficient reason for clients
to fully adopt the extensible events changes.

In room versions supporting extensible events, clients MUST only send extensible events.

Choose a reason for hiding this comment

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

What happens when an existing room with lots of "old" events is upgraded from a version not supporting extensible events to one that does?

Since events are immutable, does it mean that right after the upgrade almost all the events in the room will not be rendered by the clients anymore effectively making the room look empty?

Choose a reason for hiding this comment

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

Upgrading a room creates an entirely new room, "old" events will not be present in there.

Choose a reason for hiding this comment

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

noob alert!

Oh I wasn't aware of this, where does the spec mention it?

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

Super thanks! I naively thought such an important thing would be mentioned in https://spec.matrix.org/v1.8/rooms/ . I still have to get used at how the spec chapters are organized.

showing up in the plaintext or in tertiary formats on the events. Historically, room
moderators have been pretty good about removing these malicious senders from their rooms
when other users point out (quite quickly) that the event is appearing funky to them.

Copy link
Contributor

@Gnuxie Gnuxie May 30, 2024

Choose a reason for hiding this comment

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

m.room.power_levels provide no way of restricting what media (via mixins) you can embed into events.

Copy link
Member

@anoadragon453 anoadragon453 Jun 25, 2024

Choose a reason for hiding this comment

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

@Gnuxie could you write this up as a new matrix-spec issue to make sure it doesn't get lost?

Copy link
Contributor

Choose a reason for hiding this comment

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

@KnowledgeGarden
Copy link

Perhaps an extremely naive question, but here goes:
Suppose I want to do something in a Matrix client much like, say, Kialo, events for which are new text messages, but they are situated in the context of a parent node, which, itself, is situated in a Pro-Con debate graph; the view painted would be, first, the graph, then, when a node is selected, the graph shifts to place that node as the local "root" at the top.
My question, then, is this: can an extensible message type allow for a type which entails an entire JSON graph object with individual nodes?
Many thanks in advance - Jack

@KnowledgeGarden
Copy link

@Gnuxie Thanks for that link. I'm at a loss. It circularly points back to this issue.
m.room.power_levels is not mentioned in the latest api spec at
https://spec.matrix.org/latest/
but it is at
https://spec.matrix.org/legacy/client_server/r0.2.0.html
and
https://spec.matrix.org/unstable/rooms/v1/ and https://ems-docs.element.io/books/element-support/page/managing-a-room-advanced-room-management
There is a page on using that property at
https://snyk.io/advisor/npm-package/m/functions/m.room.power_levels

Power Levels is a State parameter. I am curious why it shows up here. I'm looking for an example of how powerlevels affects media type.
I am asking about Message Type flexibility.
I got a hint about it here
https://github.com/matrix-org/matrix-events-sdk
which is buried in Element dependencies, but that repo hasn't been touched since last year and is still marked as "work in progress" and "use at your own risk".
I suspect that extensible message types is not particularly high a priority.

@Gnuxie
Copy link
Contributor

Gnuxie commented Aug 17, 2024

@KnowledgeGarden sorry the link is unrelated, you just bumped the PR and reminded me to open an issue that i forgot about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Something needs to be done before action can be taken on this PR/issue. kind:core MSC which is critical to the protocol's success p1 proposal A matrix spec change proposal spec-pr-missing Proposal has been implemented and is being used in the wild but hasn't yet been added to the spec
Projects
Status: BLOCKED, requires spec writing
Development

Successfully merging this pull request may close these issues.