-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Describe the bug
When running a command using Tauri's shell Command that returns a lot of data some lines get skipped in stdout and the process seems to keep running indefinitely in the background, preventing future Commands and also sometimes preventing the app from refreshing properly. From my testing around 20,000+ lines in stdout causes the problem appear.
Reproduction
This repo was made as a minimal reproduction of this bug. It includes a Python script (__print_numbers.py) which prints numbers until 250,000 numbers have been printed, it starts by printing started and ends by printing done.
The amount of numbers the Python script prints can be changed in the script, usually 20,000 is enough for the bug to appear, but I made the default 250,000 since it was still bearable and should be more than enough for the bug to appear.
I recommend running it using npm run tauri dev, this is mainly due to the automatic finding of the Python file, since it looks for it at the current execution path (feel free to change this). Running it as a built binary also works, but make sure that the __print_numbers.py file is in the same directory.
Expected behavior
Everything outputted from the CLI application ran using Command would be accessible.
Platform and versions
[✔] Environment
- OS: Windows 10.0.22631 X64
✔ WebView2: 123.0.2420.65
✔ MSVC:
- Visual Studio Build Tools 2022
- Visual Studio Community 2019
✔ rustc: 1.77.1 (7cf61ebde 2024-03-27)
✔ cargo: 1.77.1 (e52e36006 2024-03-26)
✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
- node: 20.10.0
- npm: 10.5.0
- bun: 1.1.0
[-] Packages
- tauri [RUST]: 1.6.1
- tauri-build [RUST]: 1.5.1
- wry [RUST]: 0.24.7
- tao [RUST]: 0.16.8
- @tauri-apps/api [NPM]: 1.5.3
- @tauri-apps/cli [NPM]: 1.5.11
[-] App
- build-type: bundle
- CSP: unset
- distDir: ../dist
- devPath: http://localhost:1420/
- bundler: Vite
Stack trace
No response
Additional context
Here is a demo video of the issues that occur: https://www.youtube.com/watch?v=5XgFhfV7Luw
Expected behavior demo video: https://www.youtube.com/watch?v=tGq4u8yW4tI
This demo show that no matter how many times Command is used:
- The app state doesn't freeze (modifying
index.html/main.tsrefreshes the app properly) - Future processes aren't halted (new processes always finish and output correctly)
- All lines outputted to stdout are present (no missing numbers)
This is the expected behavior of Command, but this is not the behavior of Command when more than ~20,000+ lines are outputted to stdout.
Edit: Updated minimal reproduction repo to tauri 1.6.1 and the bug still occurs. Updated Platform and versions section with current information.