-
Notifications
You must be signed in to change notification settings - Fork 423
MSC2477: User-defined ephemeral events in rooms #2477
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
base: old_master
Are you sure you want to change the base?
Changes from 3 commits
aad3e26
4aa82b8
d4930c0
ba0b657
0b27339
5dc9372
dd488d3
9d73697
2f4dd47
047d63b
2cae98c
ff2ddbe
64e9460
d01e95d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,320 @@ | ||||||
| # MSC2476: User-defined ephemeral events in rooms | ||||||
|
|
||||||
| Matrix currently handles the transfer of data in the form of Persistent- as well as Ephemeral Data | ||||||
| Units, both of which follow the same general design in the way they're encoded and transferred over | ||||||
| both the Client-Server and Server-Server API. | ||||||
|
|
||||||
| Currently only users are only able to provide their own event types and data in the case of | ||||||
| persistent data, in the form of state events as well as messages / timeline events. | ||||||
| The sending of ephemeral data by clients - on the other hand - is currently limited to only typing | ||||||
| notifications, event receipts, read markers, and presence updates. Which greatly limits the | ||||||
ananace marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| potential usefulness of ephemeral events as a general mechanism for transferring short-lived data. | ||||||
|
|
||||||
| Therefore, this proposal suggest extending both the Client-Server and Server-Server APIs to allow | ||||||
| users to transfer arbitrary ephemeral data types and content into rooms in which they have the right | ||||||
| to do so. | ||||||
|
|
||||||
|
|
||||||
| ## Proposal | ||||||
|
|
||||||
| The proposed change is to add support for users to provide their own data types and content, in a | ||||||
| similar manner to the already existing support for users to send their own types of persistent data. | ||||||
|
|
||||||
| Note though that this proposal does not include any support for sending user-defined ephemeral | ||||||
| events which are not explicitly bound to rooms, like the global `m.presence` event. | ||||||
|
|
||||||
| Examples of how this feature could be used are; as regular status updates to a user-requested | ||||||
| long-lived task, which a bot might has started for a received event. Or pehaps as a GPS live-location | ||||||
ananace marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| feature, where participating client would regularly post their current location relative to a | ||||||
ananace marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| persistent geo-URI event. Perhaps for organizing meetups, or for viewing active tracking of the | ||||||
| locations of vehicles in an autonomous fleet - along with peristent messages posted at a lesser | ||||||
| rate for a timeline generation. | ||||||
ananace marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| The example that will be used througout this proposal is an ephemeral data object that's tracking | ||||||
| the current status of a user-requested 3D print, with some basic printer- and print-status | ||||||
| information being sent every few seconds to a control room, including a reference to the event that | ||||||
| the status is referring to - which the client could use to render a progress bar or other graphic | ||||||
| with. | ||||||
|
|
||||||
| ### Addition of an ephemeral event sending endpoint to the Client-Server API | ||||||
|
|
||||||
| The suggested addition to the CS API is the endpoint | ||||||
| `PUT /_matrix/client/r0/rooms/{roomId}/ephemeral/{eventType}/{txnId}`, which would act in an almost | ||||||
|
||||||
| `PUT /_matrix/client/r0/rooms/{roomId}/ephemeral/{eventType}/{txnId}`, which would act in an almost | |
| `PUT /_matrix/client/v1/rooms/{roomId}/ephemeral/{eventType}/{txnId}`, which would act in an almost |
Following the new per-endpoint versioning spec.
ananace marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
ananace marked this conversation as resolved.
Show resolved
Hide resolved
ananace marked this conversation as resolved.
Show resolved
Hide resolved
ananace marked this conversation as resolved.
Show resolved
Hide resolved
ananace marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"optional but suggested" is not really a state we can support. If we're bumping room versions, we should make it required.
It's also unclear how this would apply to something like presence which is not bound to a room and already duplicates this information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This proposal was by design only made for room-specific ephemeral events, so presence - as a non-room-bound EDU - shouldn't be affected. I'll try to make this more clear.
ananace marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
ananace marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
room_id isn't part of the spec for ephemeral event bodies down /sync.
Likewise below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec entry you linked includes an m.typing event in the example response for code 200, which does include room_id in the data;
# ...
"join": {
"!726s6s6q:example.com": {
"account_data": {
"events": [
{
"content": {
"tags": {
"u.work": {
"order": 0.9
}
}
},
"type": "m.tag"
},
{
"content": {
"custom_config_key": "custom_config_value"
},
"type": "org.example.custom.room.config"
}
]
},
"ephemeral": {
"events": [
{
"content": {
"user_ids": [
"@alice:matrix.org",
"@bob:example.com"
]
},
"room_id": "!jEsUZKDJdhlrceRyVU:example.org",
"type": "m.typing"
}
]
},
# ...I think that's where that came from, since I tried to base my examples directly on the spec examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks for pointing that out! I've made a PR to fix that, as I believe that's a spec bug: #3679.
ananace marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
anoadragon453 marked this conversation as resolved.
Show resolved
Hide resolved
ananace marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels suboptimal because it means the room admin needs to know the entire superset of features of all potential clients which may join the room. Consider:
- I create a room on a terminal client that has no knowledge of any of these custom EDUs.
- 6 people join all on clients capable of showing printer status updates.
- See how sad they become as they can't use the feature.
To resolve this requires a fair bit of social work as either:
- someone asks the admin to allow the custom type (assuming the client they are using let's them do this)
- someone asks the admin to make one of the 6 users a mod/admin/to have enough power for their client to automatically (or manually) enable the sending of that custom type.
ananace marked this conversation as resolved.
Show resolved
Hide resolved
anoadragon453 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unstable prefixes will need to be defined in order for an implementation of the MSC to be carried out. I suggest implementation replace:
ephemeralandephemeral_defaultfields in them.room.power_levelsstate event withorg.matrix.msc2477.ephemeralandorg.matrix.msc2477.ephemeral_defaultrespectively.- the
PUT /_matrix/client/v1/rooms/{roomId}/ephemeral/{eventType}/{txnId}endpoint withPUT /_matrix/client/unstable/org.matrix.msc2477/rooms/{roomId}/ephemeral/{eventType}/{txnId}.
And an experimental room version with name org.matrix.msc2477 should be used where this feature is enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And a whole lot later than it should've been, but I've added a section on an unstable prefix.
Wasn't sure about adding blurbs on when the m.room.power_levels keys should be allowed, but I figured that it'd a bit superfluous since the only method that will act on them is limited to the experimental room version.
Uh oh!
There was an error while loading. Please reload this page.