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

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

Closed
s3xysteak opened this issue Apr 10, 2024 · 6 comments · Fixed by tauri-apps/tauri#9463
Closed

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

s3xysteak opened this issue Apr 10, 2024 · 6 comments · Fixed by tauri-apps/tauri#9463
Labels
bug Something isn't working

Comments

@s3xysteak
Copy link

s3xysteak commented Apr 10, 2024

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.

@s3xysteak
Copy link
Author

s3xysteak commented Apr 10, 2024

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

@FabianLars FabianLars transferred this issue from tauri-apps/tauri Apr 10, 2024
@FabianLars FabianLars changed the title [bug] v2 comment.execute() has been waiting for a response. [shell] v2 comment.execute() has been waiting for a response. Apr 10, 2024
@FabianLars FabianLars added the bug Something isn't working label Apr 10, 2024
@FabianLars
Copy link
Member

@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.

@bling-yshs
Copy link

#1153 same problem

@s3xysteak
Copy link
Author

s3xysteak commented Apr 15, 2024

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.

@FabianLars
Copy link
Member

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

@AmeroHan
Copy link

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

me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants