tauri-apps / plugins-workspace

All of the official Tauri plugins in one place!

Home Page:https://tauri.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[shell] v2 `comment.execute()` has been waiting for a response.

s3xysteak opened this issue · comments

Describe the bug

Refer to #9424.

Here is my code:

const steamInstallDirectoryQuery
= 'Get-ItemProperty -Path HKLM:\\SOFTWARE\\WOW6432Node\\Valve\\Steam -Name "InstallPath"'

console.log('start')

const res = await Command
  .create('powershell', steamInstallDirectoryQuery)
  .execute()

console.log('end')

it keeps waiting for the response of that. It logs start, but after a long time, it still did not log end.

The weirdest thing is that on rare occasions it occasionally works fine.

I use the command directly in powershell and it works well.

Reproduction

https://github.com/s3xysteak/tauri-v2-reproduction-Get-ItemProperty-Error

step 1. pnpm i
step 2. pnpm tauri build
step 3. Click the Greeting button and sometimes it will keep loading and never be resolved.

That is how I make the reproduction:

  1. pnpm create tauri-app --beta.
  2. Change code in src/components/Greet.vue.
  3. Edit src-tauri/capabilities/default.json

Expected behavior

In the reproduction, it should stablely change the greeting text and the text in button should quickly turn greeting to loading... to greeting.

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.19045 X64
    ✔ WebView2: 123.0.2420.65
    ✔ MSVC: Visual Studio Community 2022
    ✔ 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
    - pnpm: 8.15.5
    - npm: 10.2.3

[-] Packages
    - tauri [RUST]: 2.0.0-beta.14
    - tauri-build [RUST]: 2.0.0-beta.11   
    - wry [RUST]: 0.39.0
    - tao [RUST]: 0.27.0
    - @tauri-apps/api [NPM]: 2.0.0-beta.7 
    - @tauri-apps/cli [NPM]: 2.0.0-beta.12

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/      
    - framework: Vue.js
    - bundler: Vite

Stack trace

There is no error message. It looked like he was just blocked.

Additional context

I run pnpm tauri build and send the result .exe file to my friends, and they have the same issue too.

They are using win10/11 and have no Node.js/Rust Env in system.

It also happened to GitForWindows. Get-ItemProperty -Path HKLM:\\SOFTWARE\\GitForWindows -Name "InstallPath".

@lucasfernog Is it possible that the Channel implementation can't handle quick events? On my system it can only handle ~5 events in this repro and the rest never get to the frontend. If i add a 1 milisecond delay between the events all of them get through though.

#1153 same problem

Hi, here we have more information:

  1. In unlucky times, even the first click can trigger this issue. (confirmed in tauri build).
  2. It seems that the issue is more likely to be triggered in the tauri build version compared to the tauri dev version (not certain).
  3. Even after trying node -v many times, the issue was NOT triggered. I haven't found any other commands that trigger this issue yet.
  4. The command Get-ItemProperty works well in v1. Even after trying many times the issue was not triggered in v1.

Seems to be fixed by tauri-apps/tauri#9463, at least in my testing.

Seems to be fixed by tauri-apps/tauri#9463, at least in my testing.

me too