Skip to content
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

fix(wasm): don't kill task on drop #4572

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maan2003
Copy link
Contributor

makes behavior similar to tokio::spawn otherwise spawned tasks immediately die if join handles are not saved somewhere

@maan2003 maan2003 requested a review from a team as a code owner January 22, 2025 11:23
@maan2003 maan2003 requested review from jmartinesp and removed request for a team January 22, 2025 11:23
@maan2003
Copy link
Contributor Author

cc @jplatte

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 85.37%. Comparing base (2657eb7) to head (3818d1c).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk-common/src/executor.rs 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4572      +/-   ##
==========================================
- Coverage   85.39%   85.37%   -0.02%     
==========================================
  Files         286      286              
  Lines       32229    32235       +6     
==========================================
  Hits        27522    27522              
- Misses       4707     4713       +6     

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

@Hywan Hywan requested review from Hywan and removed request for jmartinesp January 27, 2025 16:21
#[cfg(target_arch = "wasm32")]
impl<T> Drop for JoinHandle<T> {
fn drop(&mut self) {
// don't abort the spawned future
Copy link
Member

Choose a reason for hiding this comment

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

This comment must be elaborated to explain why we don't abort the future when the join handle is dropped:

  • Why?
  • Does it match the Tokio's behaviour?

Thanks.

@Hywan
Copy link
Member

Hywan commented Jan 28, 2025

Thanks for your contribution :-).

It would be nice if you could address my comment, and if tests could be added. This is an important change.

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.

2 participants