tauri-apps/tauri

[bug] The asynchronous command is re-invoked when the WebView reloads.

Open

#14154 opened on Sep 5, 2025

View on GitHub
 (12 comments) (0 reactions) (0 assignees)Rust (106,642 stars) (3,597 forks)batch import
help wantedtype: bug

Description

Describe the bug

When you reload a WebView while an asynchronous command is running, the command you initiated is automatically re-invoked.

Reproduction

https://github.com/kanatapple/tauri-app-command

  1. Run app
  2. Open Dev Tools
  3. Click greet button
  4. Execute location.reload() in Dev Tools(while the greet command is running)

Expected behavior

Unfinished commands are not re-invoked when the WebView reloads.

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.26100 x86_64 (X64)
    ✔ WebView2: 139.0.3405.125
    ✔ MSVC:
        - Visual Studio Professional 2017
        - Visual Studio Professional 2019
    ✔ rustc: 1.89.0 (29483883e 2025-08-04)
    ✔ cargo: 1.89.0 (c24e10642 2025-06-23)
    ✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 22.14.0
    - yarn: 1.22.22
    - npm: 10.9.2

[-] Packages
    - tauri 🦀: 2.8.4
    - tauri-build 🦀: 2.4.0
    - wry 🦀: 0.53.3
    - tao 🦀: 0.34.3
    - @tauri-apps/api : 2.2.0
    - @tauri-apps/cli : 2.0.0

[-] Plugins
    - tauri-plugin-http 🦀: 2.5.2
    - @tauri-apps/plugin-http : not installed!
    - tauri-plugin-log 🦀: 2.6.0
    - @tauri-apps/plugin-log : not installed!
    - tauri-plugin-dialog 🦀: 2.3.3
    - @tauri-apps/plugin-dialog : 2.0.0
    - tauri-plugin-fs 🦀: 2.4.2
    - @tauri-apps/plugin-fs : not installed!
    - tauri-plugin-updater 🦀: 2.9.0
    - @tauri-apps/plugin-updater : not installed!

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

Stack trace

Additional context

No response

Contributor guide