You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: proposals/4140-delayed-events-futures.md
+34-1Lines changed: 34 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,7 +176,40 @@ this endpoint can be minimized.
176
176
177
177
### MatrixRTC
178
178
179
-
We want can use the actions and the timeout for matrix rtc for the following situations
179
+
#### Background
180
+
181
+
MatrixRTC makes it necessary to have real time information about the current matrixRTC session.
182
+
To properly display room tiles and header in the room list (or compute a list of ongoing calls) need to know:
183
+
184
+
- If there is a running session.
185
+
- What type that session has.
186
+
- Who and how many perople are currently participating.
187
+
188
+
A particular delicat situation is that clients are not able to inform others if they loose connection.
189
+
There are numerous approaches to solve such a situation. They split into two categories:
190
+
191
+
- Polling based
192
+
- Ask the users if they are still connected.
193
+
- Ask an RTC backend (SFU) who is connected.
194
+
- Timeout based
195
+
- Update the room state every x seconds. This allows clients to check how long an event has not been updated and ignore it if its expired.
196
+
- Use Future events with a 10s timeout to send the disconnected from call in less then 10s after the user is not anymore pingin the `/refresh` endpoint. (or delegate the disconnect action to a service attached to the SFU)
197
+
198
+
Polling based solution have a big overhead in complexity and network requests on the clients.
199
+
Example:
200
+
201
+
> A room list with 100 rooms where there has been a call before in every room (or there is an ongoing call) would require the client to send a to-device message (or a request to the SFU) to every user that has an active state event to check if they are still online. Just to display the room tile properly.
202
+
203
+
For displaying the room list timeout based approaches are much more reasonable because this allows computing matrixRTC metadata for a room to be synchronous.
204
+
205
+
The current solution updates the room state every X minutes. This is not elegant since we basically resend room state with the same content. In large calls this could result in huge traffic/large DAGs (100 call members implies 100 state events every X minutes.) X cannot be a long duration because it is the duration after which we can consider the event as expired. Improper disconnects would result in the user being displayed as "still in the call" for X minutes (we want this to be as short as possible!)
206
+
207
+
Additionally this approach requires perfect server client time synchronization to compute the expiration.
208
+
This is currently not possible over federation since `unsigned.age` is not available over federation.
209
+
210
+
#### Possible solution
211
+
212
+
With this proposal we can provide an elegant solution using actions and timeouts to only send one event for joining and one for leaving (reliably)
180
213
181
214
- If the client takes care of its membership, we use a short timeout value (around 5-20 seconds)
182
215
The client will have to ping the refresh endpoint approx every 2-19 seconds.
0 commit comments