-
Notifications
You must be signed in to change notification settings - Fork 434
MSC4407: Sticky Events (widget-api) #4407
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
Open
toger5
wants to merge
7
commits into
main
Choose a base branch
from
toger5/sticky-events-widget-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+63
−0
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4f79ebe
initial commit "Sticky-events for the widget api"
toger5 de99040
update to correct MSC number
toger5 820e915
rename
toger5 22f8bb3
update
toger5 cac893e
Update 4407-sticky-events-widget-api.md
toger5 e5184f8
Update 4407-sticky-events-widget-api.md
toger5 75dfead
simplify and make receive client bahviour more explicit
toger5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Sticky Events (Widget API) | ||
|
|
||
| With [MSC4354](https://github.com/matrix-org/matrix-spec-proposals/pull/4354), a way to send sticky events is introduced. | ||
| Sticky events are room events with a time-limited delivery guarantee. They will be synced by participating clients even across gappy syncs, for the duration specified by `sticky_duration_ms`. | ||
|
|
||
| This MSC only specifies how the Widget API uses this concept. [MSC4354](https://github.com/matrix-org/matrix-spec-proposals/pull/4354) | ||
| gives more details about sticky events themselves. | ||
|
|
||
| Exposing sticky events to widgets is required for widgets implementing MatrixRTC. | ||
| Sticky events are needed for encrypted MatrixRTC membership events to be reliably delivered. | ||
|
|
||
| Since ElementCall (EC) is a widget and is based on MatrixRTC, this Widget API proposal is required for EC to work. | ||
|
|
||
| ## Proposal | ||
|
|
||
| ### Sending sticky events | ||
|
|
||
| We extend the "send_event" request defined by [MSC2762](https://github.com/matrix-org/matrix-spec-proposals/pull/2762) | ||
| as follows: | ||
|
|
||
| ```jsonc | ||
| { | ||
| // new | ||
| sticky_duration_ms?: number; | ||
| // other fields | ||
| state_key?: string; | ||
| type: string; | ||
| content: unknown; | ||
| room_id?: string; | ||
| delay?: number; // from https://github.com/matrix-org/matrix-spec-proposals/pull/4157 | ||
| } | ||
| ``` | ||
|
|
||
| ### Capabilities | ||
|
|
||
| Two new capabilities will be introduced: | ||
|
|
||
| - `m.send.sticky_event`\ | ||
| Allows sending sticky events by using the optional `sticky_duration_ms` property in a `fromWidget send_event` widget action. | ||
| All other `m.send.*` capabilities still apply. This capability allows sending sticky events for those types. | ||
| - `m.receive.sticky_event`\ | ||
| If this capability is allowed, the client will make sure the widget is aware of events that are currently sticky. | ||
| All events that are currently sticky, of types that are allowed by `m.send.*` capabilities, will be included. | ||
|
|
||
| ### Widget Client Implementation | ||
|
|
||
| If a widget is granted the `m.receive.sticky_event` capability, the host client must do the following: | ||
| - On widget startup, the client will send all sticky events that the widget is allowed to see. | ||
| - After capability re-negotiation, when the widget is now granted `m.receive.sticky_event` and was not before, the client will send all currently sticky events that the widget is allowed to see. | ||
|
|
||
| If the capability `m.send.sticky_event` is granted and the client receives a send event with `sticky_duration_ms` set, the client must send a sticky event | ||
| as described in [MSC4354](https://github.com/matrix-org/matrix-spec-proposals/pull/4354), using the `sticky_duration_ms`. | ||
|
|
||
| ## Alternatives | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This section appears incomplete, and a few sections look like they're missing too fwiw. |
||
|
|
||
| ## Unstable prefix | ||
|
|
||
| The following strings will have unstable prefixes: | ||
|
|
||
| - The send sticky event capability:\ | ||
| `m.send.sticky_event` -> `org.matrix.msc4407.send.sticky_event` | ||
| - The receive sticky event capability:\ | ||
| `m.receive.sticky_event` -> `org.matrix.msc4407.receive.sticky_event` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Implementation requirements: