Skip to content

WidgetDriver: Use matrix_sdk_common::executor::spawn instead of tokio::spawn to make it wasm compatible.#4959

Merged
bnjbvr merged 2 commits intomainfrom
toger5/widget-driver-spawn-wasm-compatible
Apr 23, 2025
Merged

WidgetDriver: Use matrix_sdk_common::executor::spawn instead of tokio::spawn to make it wasm compatible.#4959
bnjbvr merged 2 commits intomainfrom
toger5/widget-driver-spawn-wasm-compatible

Conversation

@toger5
Copy link
Copy Markdown
Contributor

@toger5 toger5 commented Apr 22, 2025

This PR is a revived version of: #4707 since it is now possible to easily add wasm support thanks to: #4572

Using the executer::spawn will select tokio::spawn or wasm_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 wasm spawn wrapper will only start the part that is not inside the async block and the join handle needs to be awaited for it to work.

This has now changed with: #4572.
Now they behave the same and this PR becomes a very simple change.

  • Public API changes documented in changelogs (optional)

Signed-off-by:

@toger5 toger5 force-pushed the toger5/widget-driver-spawn-wasm-compatible branch from 2ca6fd5 to 3e06868 Compare April 22, 2025 14:05
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.93%. Comparing base (d2874af) to head (ae83b6c).
Report is 25 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4959      +/-   ##
==========================================
- Coverage   85.95%   85.93%   -0.02%     
==========================================
  Files         325      325              
  Lines       35649    35649              
==========================================
- Hits        30641    30636       -5     
- Misses       5008     5013       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@toger5 toger5 marked this pull request as ready for review April 22, 2025 14:30
@toger5 toger5 requested a review from a team as a code owner April 22, 2025 14:30
@toger5 toger5 requested review from bnjbvr and removed request for a team April 22, 2025 14:30
@toger5 toger5 force-pushed the toger5/widget-driver-spawn-wasm-compatible branch from 3e06868 to f503739 Compare April 23, 2025 06:39
Copy link
Copy Markdown
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! just one small nit :)

@toger5 toger5 force-pushed the toger5/widget-driver-spawn-wasm-compatible branch from f503739 to 3560e7e Compare April 23, 2025 11:21
@toger5 toger5 requested a review from bnjbvr April 23, 2025 11:21
This makes it possible to use the widget driver with the wasm target. It allows us to use the `DropGuard`.
@toger5 toger5 force-pushed the toger5/widget-driver-spawn-wasm-compatible branch from 3560e7e to ae83b6c Compare April 23, 2025 11:22
@bnjbvr bnjbvr merged commit 6c4a438 into main Apr 23, 2025
43 checks passed
@bnjbvr bnjbvr deleted the toger5/widget-driver-spawn-wasm-compatible branch April 23, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants