tauri-apps / tauri-apps/plugins-workspace

[bug] [CATransaction synchronize] called within transaction when using dialog/open

Open
#2,147 2 comments 2 reactions 0 assignees View on GitHub
platform: macos plugin: dialog type: bug
Dominant language
Rust
Stars
1.8k
Forks
602
Avg merge
4d 14h
Merged PRs (30d)
9

Description

### Describe the bug

whenever I use the `open` function from `@tauri-apps/api/dialog` on a mac, I see this warning on console:

```
2023-02-03 13:53:28.639 Aptakube[29784:2233503] +[CATransaction synchronize] called within transaction
```

The dialog open just file and everything works as expected, but there's a ~2 seconds delay to open the dialog.

### Reproduction

```tsx
import { open } from "@tauri-apps/api/dialog";

export function AddNewLocationItem() {
const addNew = () => {
open({
multiple: true,
directory: false,
}).then(console.log);
};

return (


  • Add new

  • );
    }
    ```

    This is the code I used.

    ### Expected behavior

    It should not print that message and hopefully that would make it a bit faster as well 😅

    ### Platform and versions

    ```
    Environment
    › OS: Mac OS 13.1.0 X64
    › Node.js: 18.12.1
    › npm: 8.9.0
    › pnpm: 7.6.0
    › yarn: 1.22.19
    › rustup: 1.25.1
    › rustc: 1.65.0
    › cargo: 1.65.0
    › Rust toolchain: stable-aarch64-apple-darwin

    Packages
    › @tauri-apps/cli [NPM]: 1.2.3
    › @tauri-apps/api [NPM]: 1.2.0
    › tauri [RUST]: 1.2.3,
    › tauri-build [RUST]: 1.2.1,
    › tao [RUST]: 0.15.6,
    › wry [RUST]: 0.23.4,

    App
    › build-type: bundle
    › CSP: unset
    › distDir: ../dist
    › devPath: http://localhost:5173/
    › framework: SolidJS
    › bundler: Vite

    App directory structure
    ├─ design
    ├─ dist
    ├─ node_modules
    ├─ etc
    ├─ examples
    ├─ .github
    ├─ src-tauri
    ├─ .git
    ├─ .vscode
    ├─ coverage
    └─ src
    ```

    ### Stack trace

    _No response_

    ### Additional context

    _No response_

    Contributor guide

    Open the contributing guide

    Assessment

    This issue has not been assessed yet.

    Get new issues in your inbox

    A short digest of beginner-friendly GitHub issues.