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

[macOS] APP crash when a web custom protocol request is aborted before or during response #1189

Open
idootop opened this issue Mar 13, 2024 · 3 comments · May be fixed by #1214
Open

[macOS] APP crash when a web custom protocol request is aborted before or during response #1189

idootop opened this issue Mar 13, 2024 · 3 comments · May be fixed by #1214

Comments

@idootop
Copy link

idootop commented Mar 13, 2024

Describe the bug

When initiating a register_uri_scheme_protocol request from the web side, if the web aborts the request before or during the response, the macOS APP crashes.

Reproduction

  • Register a register_asynchronous_uri_scheme_protocol.
  • From the web side, initiate a request using this protocol and abort the request before the response.
  • The APP crashes 100% of the time.

Expected behavior

  • Before responding, the responder should check if the request has been canceled. If the request has been canceled, do not send the response.
  • Or, during the response, catch exceptions to prevent the APP from crashing and quitting abruptly when the request is terminated.

Full tauri info output

[✔] Environment
    - OS: Mac OS 13.6.3 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.76.0 (07dca489a 2024-02-04)
    ✔ cargo: 1.76.0 (c84b36747 2024-01-18)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-apple-darwin (default)
    - node: 18.17.1
    - pnpm: 8.15.4
    - npm: 9.6.7

[-] Packages
    - tauri [RUST]: 2.0.0-beta.10
    - tauri-build [RUST]: 2.0.0-beta.8
    - wry [RUST]: 0.37.0
    - tao [RUST]: 0.26.1
    - @tauri-apps/api [NPM]: 2.0.0-beta.5
    - @tauri-apps/cli [NPM]: 2.0.0-beta.9

[-] App
    - build-type: bundle
    - CSP: default-src x-http: x-https: blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'
    - frontendDist: ../feiyu/dist
    - devUrl: http://localhost:3000/

Stack trace

thread 'tokio-runtime-worker' panicked at /Users/mac/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wry-0.37.0/src/wkwebview/mod.rs:262:28:
Uncaught exception <NSException: 0x10428cf30>

Additional context

Related code:

let () = msg_send![task, didReceiveResponse: response];

图片

Related issue: tauri-apps/tauri#9177

@morajabi
Copy link
Contributor

morajabi commented Apr 5, 2024

Seems like this is the cause of #1142?

@morajabi
Copy link
Contributor

morajabi commented Apr 8, 2024

Do you have an idea on how to fix this issue?

@FabianLars
Copy link
Member

#1214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants