Skip to content

Commit cc0d665

Browse files
committed
initial draft
1 parent 36c5ec4 commit cc0d665

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Futures for the widget api
2+
3+
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
4+
be inserted into the dag (and distributed to all clients and federating servers) a time after **now** (based on timeout or delegation conditions).
5+
6+
This is an extension to the client server api to expose Futures to widgets.
7+
This can be useful for numerous widgets. It is required for widgets implementing MatrixRTC.
8+
Futures are needed for reliable MatrixRTC memberships that get cleaned up when a client looses network connection.
9+
10+
Since ElementCall (EC) is a widget and based on MatrixRTC this widget api proposel is required for EC to work.
11+
12+
## Proposal
13+
14+
We extend the send
15+
`"send_event"` request:
16+
17+
```
18+
{
19+
state_key?: string;
20+
type: string;
21+
content: unknown;
22+
room_id?: string;
23+
24+
timeout?: number;
25+
group_id?: string;
26+
}
27+
```
28+
29+
and the `"send_event"` response:
30+
31+
```
32+
{
33+
room_id: string;
34+
event_id: string;
35+
36+
group_id: string;
37+
send_token: string;
38+
cancel_token: string;
39+
refresh_token: string;
40+
}
41+
```
42+
43+
to provide the same properties needed for [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140). The client is responsible to check
44+
for the field `timeout` or `group_id` of the widget action and send a `/send` or `/send_future` http request
45+
if one of them is present.
46+
47+
Additionally the response is extended with the tokens and the group_id.
48+
49+
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
50+
any of the details about futures.

0 commit comments

Comments
 (0)