Skip to content

[bug] [macOS] NSOpenPanel openPanel returns NULL #13047

@dwosk

Description

@dwosk

Describe the bug

On startup, my application will check for updates and automatically download and install them in the background. Once complete, the app will display a "Restart app" indicator to the user so that they can restart the app when they are ready to apply the update.

However, it seems like after an update is installed, opening a file dialog will result in a panic. For example, via the open export of @tauri-apps/plugin-dialog.

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.4.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: 1.81.0-aarch64-apple-darwin (overridden by '/Users/dwosk/development/projects/desktop-app/dev/rust-toolchain.toml')
    - node: 22.2.0
    - npm: 10.7.0

[-] Packages
    - tauri 🦀: 2.3.1
    - tauri-build 🦀: 2.0.6
    - wry 🦀: 0.50.1
    - tao 🦀: 0.32.8
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli : 2.3.1 (outdated, latest: 2.4.0)

[-] Plugins
    - tauri-plugin-updater 🦀: 2.5.1
    - @tauri-apps/plugin-updater : not installed!
    - tauri-plugin-fs 🦀: 2.2.0
    - @tauri-apps/plugin-fs : not installed!
    - tauri-plugin-os 🦀: 2.2.0
    - @tauri-apps/plugin-os : not installed!
    - tauri-plugin-deep-link 🦀: 2.2.0
    - @tauri-apps/plugin-deep-link : not installed!
    - tauri-plugin-single-instance 🦀: 2.2.2
    - @tauri-apps/plugin-single-instance : not installed!
    - tauri-plugin-dialog 🦀: 2.2.0
    - @tauri-apps/plugin-dialog : not installed!
    - tauri-plugin-notification 🦀: 2.2.1
    - @tauri-apps/plugin-notification : not installed!
    - tauri-plugin-process 🦀: 2.2.0
    - @tauri-apps/plugin-process : not installed!

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../../frontend/build
    - devUrl: http://localhost:3000/

Stack trace

2025-03-21 14:10:50.211 aspera-desktop[84277:17278983] +[NSXPCSharedListener endpointForReply:withListenerName:replyErrorCode:]: an error occurred while attempting to obtain endpoint for listener 'com.apple.view-bridge': Connection interrupted
2025-03-21T21:10:50.212220Z ERROR desktop_app: Uncaught panic location="/Users/dwosk/.cargo/registry/src/.../objc2-app-kit-0.2.2/src/generated/NSOpenPanel.rs:110:1" app_version="1.0.7 (0)" app_commit_sha="d42cd84c9804" release_channel="dev" os_name="macOS" os_version="14.4.1" architecture="aarch64" timestamp=1742591450212
thread 'main' panicked at /Users/dwosk/.cargo/registry/src/.../objc2-app-kit-0.2.2/src/generated/NSOpenPanel.rs:110:1:
unexpected NULL returned from +[NSOpenPanel openPanel]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2025-03-21T21:10:50.212960Z ERROR desktop_app: Uncaught panic location="/Users/dwosk/.cargo/registry/src/.../tauri-plugin-dialog-2.2.0/src/lib.rs:616:9" app_version="1.0.7 (0)" app_commit_sha="d42cd84c9804" release_channel="dev" os_name="macOS" os_version="14.4.1" architecture="aarch64" timestamp=1742591450212
thread 'tokio-runtime-worker' panicked at /Users/dwosk/.cargo/registry/src/.../tauri-plugin-dialog-2.2.0/src/lib.rs:616:9:
called `Result::unwrap()` on an `Err` value: RecvError

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions