-
Notifications
You must be signed in to change notification settings - Fork 415
MSC4157: Delayed Events (widget api) #4157
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
Draft
toger5
wants to merge
10
commits into
main
Choose a base branch
from
toger5/future-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.
Draft
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cc0d665
initial draft
toger5 62a370d
make response fields optional
toger5 9e21a30
rename to make it compatible with the http endpoints
toger5 4b83b1b
Replace future_group_id with parent_future_id
AndrewFerr c1e4cdf
Mention new/edited fields from original spec
AndrewFerr eed0875
Link to MSC2762, which this MSC builds upon
AndrewFerr 5d25016
add update future widget action
toger5 5bf978e
update to naming decisions
toger5 3f46cb5
add alternative and more details
toger5 c3aa205
typo fix
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,50 @@ | ||
| # Futures for the widget api | ||
|
|
||
| With [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) a way to send Future events is introduced. Futures are events that are send **now** but will | ||
| be inserted into the dag (and distributed to all clients and federating servers) a time after **now** (based on timeout or delegation conditions). | ||
|
|
||
| This is an extension to the client server api to expose Futures to widgets. | ||
| This can be useful for numerous widgets. It is required for widgets implementing MatrixRTC. | ||
| Futures are needed for reliable MatrixRTC memberships that get cleaned up when a client looses network connection. | ||
|
|
||
| Since ElementCall (EC) is a widget and based on MatrixRTC this widget api proposel is required for EC to work. | ||
|
|
||
| ## Proposal | ||
|
|
||
| We extend the send | ||
| `"send_event"` request: | ||
|
|
||
| ``` | ||
| { | ||
| state_key?: string; | ||
| type: string; | ||
| content: unknown; | ||
| room_id?: string; | ||
|
|
||
| future_timeout?: number; | ||
| future_group_id?: string; | ||
| } | ||
| ``` | ||
|
|
||
| and the `"send_event"` response: | ||
|
|
||
| ``` | ||
| { | ||
| room_id: string; | ||
| event_id?: string; | ||
|
|
||
| future_group_id?: string; | ||
| send_token?: string; | ||
| cancel_token?: string; | ||
| refresh_token?: string; | ||
| } | ||
| ``` | ||
|
|
||
| to provide the same properties needed for [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140). The client is responsible to check | ||
| for the field `future_timeout` or `future_group_id` of the widget action and send a `/send` or `/send_future` http request | ||
| if one of them is present. | ||
|
|
||
| Additionally the response is extended with the tokens and the `future_group_id`. | ||
|
|
||
| All other details about the future concept can be found in [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) so here we intentionally don't mention | ||
| any of the details about futures. | ||
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.
Uh oh!
There was an error while loading. Please reload this page.