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

[bug] two windows showing from dev command #7273

Closed
simonhyll opened this issue Jun 21, 2023 · 1 comment
Closed

[bug] two windows showing from dev command #7273

simonhyll opened this issue Jun 21, 2023 · 1 comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@simonhyll
Copy link
Sponsor Contributor

simonhyll commented Jun 21, 2023

Describe the bug

A user reported an issue in the Discord server about having 2 windows popping up for them. After quite a bit of debugging we discovered that the cause of the issue was that the CLI is trying to connect to Github to fetch the metadata.json file to check if there's a newer version available. Because they live in India with the Jio ISP they aren't allowed to connect to Github however they want. The issue seems to be that when they launch one dev command it takes like 15-20 seconds or so for it to exit, and the culprit appears to be the update checking. When they connect to a VPN the issue goes away. That's right, they get 2 windows popping up, and the fix it connecting to a VPN. Logic 👍🏻

The issue appears to be caused by an orphaned process as a result of improper handling of abrupt closing of the app. If they sit patiently and wait for it to exit, there's no issue. It only happens when they exit the app prematurely with ctrl + c.

Reproduction

There shouldn't be anything special about the project setup, the issue is in the CLI. So set up a basic CTA project and run it as per usual. The trick is that the user in question with the issue is in a country where the ISP doesn't allow connecting to Github however they want, so they had to use a VPN solution for it. So not entirely sure how to replicate it if you're not in one of those countries. Maybe VPN into one of those countries.

  1. Move to India
  2. Get internet from the ISP "Jio"
  3. yarn create tauri-app
  4. yarn tauri dev
  5. ctrl + c out of the app because it takes like 20 seconds for it to exit
  6. yarn tauri dev

You should now be seeing 2 windows.

Expected behavior

One window should appear, not two. The update checking should've exited immediately and not been the cause of some orphaned process in the background causing issues.

My suggestion for resolving this is moving the functionality away from the dev command entirely, split it off into a dedicated check-updates command instead.

In addition to this we still need to add some more proper handling of the update checker so that there's no orphaned processes. If the dev command had exited properly in the first place this issue probably wouldn't have surfaced.

Platform and versions

yarn run v1.22.19
$ tauri info

[✔] Environment
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 114.0.1823.51
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.70.0-nightly (9df3a39fb 2023-04-11)
    ✔ Cargo: 1.70.0-nightly (7bf43f028 2023-04-10)
    ✔ rustup: 1.25.2 (17db695f1 2023-02-01)
    ✔ Rust toolchain: nightly-x86_64-pc-windows-msvc (default)
    - node: 18.15.0
    - yarn: 1.22.19
    - npm: 9.5.0

[-] Packages
    - tauri [RUST]: 1.4.1
    - tauri-build [RUST]: 1.4.0
    - wry [RUST]: 0.24.3
    - tao [RUST]: 0.16.2
    - @tauri-apps/api [NPM]: 1.4.0
    - @tauri-apps/cli [NPM]: 1.4.0

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: Svelte
    - bundler: Vite
Done in 10.31s.

Stack trace

No response

Additional context

The affected user goes by the name "Best" with handle "bestc" in the Discord server.

Workaround

If you're affected by this you can try the debug version of the CLI instead since it shouldn't be checking for updates. Or you can get a VPN.
cargo install tauri-cli --debug

@simonhyll simonhyll added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jun 21, 2023
@simonhyll simonhyll changed the title [bug] two windows showing because metadata fetching fails [bug] two windows showing from dev command Jun 21, 2023
@FabianLars
Copy link
Member

FabianLars commented Jun 21, 2023

When we renamed the package names in the metadata file somewhere around v1.3 you could spawn even more windows. Everytime you restarted it, the amount of windows ~doubled.

But yeah, like discussed on Discord i really think this "feature" should be removed completely (especially now that it shows the wrong version too).

I'll try to work on that today if nobody is against that.

Edit: I wrote this comment before seeing the new discord convos about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants