File tree 1 file changed +7
-3
lines changed
bindings/matrix-sdk-ffi/src/timeline
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -256,10 +256,14 @@ impl Timeline {
256
256
. await
257
257
. context ( "can't subscribe to the back-pagination status on a focused timeline" ) ?;
258
258
259
- Ok ( Arc :: new ( TaskHandle :: new ( get_runtime_handle ( ) . spawn ( async move {
260
- // Send the current state even if it hasn't changed right away.
261
- listener. on_update ( initial) ;
259
+ // Send the current state even if it hasn't changed right away.
260
+ //
261
+ // Note: don't do it in the spawned function, so that the caller is immediately
262
+ // aware of the current state, and this doesn't depend on the async runtime
263
+ // having an available worker
264
+ listener. on_update ( initial) ;
262
265
266
+ Ok ( Arc :: new ( TaskHandle :: new ( get_runtime_handle ( ) . spawn ( async move {
263
267
while let Some ( status) = subscriber. next ( ) . await {
264
268
listener. on_update ( status) ;
265
269
}
You can’t perform that action at this time.
0 commit comments