fix(core): Command::output suspend while wait for response (#8539)

* fix: Command::output suspend while wait for response

* add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
This commit is contained in:
John Smith 2024-02-01 19:06:05 +08:00 committed by GitHub
parent 8ce51cec3b
commit cc3d8e7731
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch:bug
---
Fixes a deadlock when reading a stdout or stderr line returns an error.

View File

@ -420,6 +420,7 @@ fn spawn_pipe_reader<F: Fn(String) -> CommandEvent + Send + Copy + 'static>(
Err(e) => {
let tx_ = tx.clone();
let _ = block_on_task(async move { tx_.send(CommandEvent::Error(e.to_string())).await });
break;
}
}
}