-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WidgetDriver: Use matrix_sdk_common::executor::spawn
instead of tokio::spawn
to make it wasm compatible.
#4707
base: main
Are you sure you want to change the base?
Conversation
I think I need help on this since this is not the correct solution. When running on a non wasm platform the await will block.
Where we need to await the JoinHandle before the future is actually started on WASM. |
Adding the await there is definitely the wrong way to go. I don't see ny reason why it would be required on the wasm side, the docs for |
I have done a simple experiment in which this is failing however.
which results in the following outpu:
adding await to the returned handle (from |
I wonder whether the |
I tried this already. only using
without calling |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4707 +/- ##
==========================================
- Coverage 85.90% 85.89% -0.01%
==========================================
Files 292 292
Lines 33850 33851 +1
==========================================
- Hits 29078 29076 -2
- Misses 4772 4775 +3 ☔ View full report in Codecov by Sentry. |
1182bce
to
b7cdb2b
Compare
…kio::spawn` to make it wasm compatible.
b7cdb2b
to
3f544f1
Compare
Using the
executer::spawn
will selecttokio::spawn
orwasm_bindgen_futures::spawn_local
based on what platform we are on.They behave differently in that
tokio
actually starts the async block inside the spawn but the wasmspawn
wrapper will only start the part that is not inside theasync
block and the join handle needs to be awaited for it to work.Signed-off-by: