Skip to content

Commit 9f45cfa

Browse files
committed
review andrewF
Signed-off-by: Timo K <toger5@hotmail.de>
1 parent 8ec6374 commit 9f45cfa

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

proposals/4140-expiring-events-with-keep-alive-endpoint.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ time window after a user disconnected.
1919

2020
## Proposal
2121

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"`.
2525
This field lives outside the ciphertext content (hence it also works for encrypted
2626
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
2828
timeout duration in seconds.
2929

3030
Request
@@ -36,7 +36,7 @@ Request
3636
}
3737
```
3838

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
4040
event as hiding the timeout duration:
4141

4242
```json
@@ -53,43 +53,43 @@ The response to the client will be:
5353

5454
```json
5555
{
56-
"eventId": "hash_id",
57-
"expire_refresh_token": "hash_refresh",
56+
"eventId": "id_hash",
57+
"expire_refresh_token": "refresh_hash",
5858
}
5959
```
6060

6161
The default response is extended with the `expire_refresh_token` which
6262
can be used to reset the expiration timeout (in this example 10 seconds).
6363
A new unauthenticated endpoint is introduced:
6464
`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]`
6666
The body contains the refresh token so the homeserver knows what to refresh.
6767

6868
```json
6969
{
70-
"expire_refresh_token": "hash_refresh",
70+
"expire_refresh_token": "refresh_hash",
7171
}
7272
```
7373

7474
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
7676
service (an SFU for instance) that can track the current client connection state,
7777
and pings the HS to refresh and informs the HS about a disconnect.
7878

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`
8080

8181
- It generates a token and stores it alongside with the time of retrieval,
8282
the eventId and the expire duration.
83-
- Starts a counter for the stored expiation token.
83+
- Starts a timer for the stored expiration token.
8484
- If a `PUT /_matrix/client/v3/expiration/refresh` is received, the
8585
timer is restarted with the stored expire duration.
8686
- If a `PUT /_matrix/client/v3/expiration/end` is received, the
8787
event _gets ended_.
8888
- If the timer times out, the event _gets expired_.
8989
- 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.
9393

9494
The event _gets expired_/_gets ended_ means:
9595

0 commit comments

Comments
 (0)