@@ -19,12 +19,12 @@ time window after a user disconnected.
19
19
20
20
## Proposal
21
21
22
- Events can contain a ` m.will_expire: "running" | "expired" | "ended" ` field.
23
- This is an enum marking the event as
24
- expired ` m.will_expire: "expired" | "ended" ` or still alive ` m.will_expire: "running" ` .
22
+ Events can contain a ` " m.will_expire" : "running" | "expired" | "ended"` field.
23
+ This is marking the event as expired ` "m.will_expire": "expired" | "ended" ` or as
24
+ still alive ` " m.will_expire" : "running"` .
25
25
This field lives outside the ciphertext content (hence it also works for encrypted
26
26
events) and is set via the usual ` PUT ` request if the content contains the additional
27
- ` m.will_expire: 10 ` field (similar how it is done with relations), with the desired
27
+ ` " m.will_expire" : 10` field (similar how it is done with relations), with the desired
28
28
timeout duration in seconds.
29
29
30
30
Request
@@ -36,7 +36,7 @@ Request
36
36
}
37
37
```
38
38
39
- If the homeserver detects a ` m.expired ` field it will store and distribute the
39
+ If the homeserver detects a ` m.will_expire ` field it will store and distribute the
40
40
event as hiding the timeout duration:
41
41
42
42
``` json
@@ -53,43 +53,43 @@ The response to the client will be:
53
53
54
54
``` json
55
55
{
56
- "eventId" : " hash_id " ,
57
- "expire_refresh_token" : " hash_refresh " ,
56
+ "eventId" : " id_hash " ,
57
+ "expire_refresh_token" : " refresh_hash " ,
58
58
}
59
59
```
60
60
61
61
The default response is extended with the ` expire_refresh_token ` which
62
62
can be used to reset the expiration timeout (in this example 10 seconds).
63
63
A new unauthenticated endpoint is introduced:
64
64
` PUT /_matrix/client/v3/expiration/{refresh_method} `
65
- where the ` refresh_method ` is either : ` refresh ` , ` end `
65
+ where the ` refresh_method ` is one of : ` [ refresh, end] `
66
66
The body contains the refresh token so the homeserver knows what to refresh.
67
67
68
68
``` json
69
69
{
70
- "expire_refresh_token" : " hash_refresh " ,
70
+ "expire_refresh_token" : " refresh_hash " ,
71
71
}
72
72
```
73
73
74
74
The information required to call this endpoint is very limited so that almost
75
- no metadata is leaked when . This allows to share a refresh link to a different
75
+ no metadata is leaked. This allows to share a refresh link to a different
76
76
service (an SFU for instance) that can track the current client connection state,
77
77
and pings the HS to refresh and informs the HS about a disconnect.
78
78
79
- The homeserver does the following when receiving an event with ` m.expired `
79
+ The homeserver does the following when receiving an event with ` m.will_expire `
80
80
81
81
- It generates a token and stores it alongside with the time of retrieval,
82
82
the eventId and the expire duration.
83
- - Starts a counter for the stored expiation token.
83
+ - Starts a timer for the stored expiration token.
84
84
- If a ` PUT /_matrix/client/v3/expiration/refresh ` is received, the
85
85
timer is restarted with the stored expire duration.
86
86
- If a ` PUT /_matrix/client/v3/expiration/end ` is received, the
87
87
event _ gets ended_ .
88
88
- If the timer times out, the event _ gets expired_ .
89
89
- If the event is a state event only the latest/current state is considered. If
90
- the homeserver receives a new state event without ` m.expires ` but with the same
91
- state key, the expire_refresh_token gets invalidated and the associated timer is
92
- stopped.
90
+ the homeserver receives a new state event without ` m.will_expire ` but with the
91
+ same state key, the expire_refresh_token gets invalidated and the associated timer
92
+ is stopped.
93
93
94
94
The event _ gets expired_ /_ gets ended_ means:
95
95
0 commit comments