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

sentry-tauri tanks performance of my app in tauri v2 #22

Open
ottosson opened this issue Dec 24, 2024 · 4 comments
Open

sentry-tauri tanks performance of my app in tauri v2 #22

ottosson opened this issue Dec 24, 2024 · 4 comments

Comments

@ottosson
Copy link

I just migrated my (Windows) application to Tauri v2. I noticed that the application became more or less unusable due to what seems like an infinite loop somewhere in the webveiw.

The CPU went nuts and spiked around 90-100%. I tried removing sentry-tauri and the issue was gone. Re-introduce and it's back again!

I could not reproduce with a clean Tauri v2 project, so I don't understand what's causing the issue. It worked perfectly before the migration from v1 to v2.

Any ideas what's causing the issue or how I can isolate the issue to be able to report the issue better?

@timfish
Copy link
Owner

timfish commented Dec 25, 2024

Which platform and which version are you using?

There was a previous issue where passing browser breadcrumbs to the Rust backend was generating additional breadcrumbs which caused an infinite loop. If you're using the latest version there might be additional checks required.

#16

@ottosson
Copy link
Author

ottosson commented Dec 25, 2024

I tried with Tauri-sentry plugin v0.2 as well as v0.3

Here's my Tauri info output:

[✔] Environment
    - OS: Windows 10.0.26100 x86_64 (X64)
    ✔ WebView2: 131.0.2903.112
    ✔ MSVC:
        - Visual Studio Build Tools 2019
        - Visual Studio Professional 2022
    ✔ rustc: 1.83.0 (90b35a623 2024-11-26)
    ✔ cargo: 1.83.0 (5ffbef321 2024-10-29)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 22.2.0
    - npm: 10.9.1

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.2
    - tao 🦀: 0.30.8
    - @tauri-apps/api : 2.1.1
    - @tauri-apps/cli : 2.1.0

[-] Plugins
    - tauri-plugin-shell 🦀: 2.2.0
    - @tauri-apps/plugin-shell : 2.2.0
    - tauri-plugin-fs 🦀: 2.2.0
    - @tauri-apps/plugin-fs : not installed!
    - tauri-plugin-updater 🦀: 2.3.0
    - @tauri-apps/plugin-updater : 2.3.0
    - tauri-plugin-dialog 🦀: 2.2.0
    - @tauri-apps/plugin-dialog : 2.2.0

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

I believe I've narrowed the issue to the tauri.conf.json under app.windows, adding a window with "useHttpsScheme": true.

So to reproduce you can just create a new Tauri 2 project, add Tauri Sentry and change the window config to something like this:

  "app": {
    "windows": [
      {
        "title": "test",
        "width": 800,
        "height": 600,
        "useHttpsScheme": true
      }
    ],
    "security": {
      "csp": null
    }
  }

"useHttpsScheme": true seems to have been added for me automatically by the Tauri upgrade script when migrating from v1 to v2.

@timfish
Copy link
Owner

timfish commented Dec 25, 2024

I guess the change in #16 needs to also check https too!

@ottosson
Copy link
Author

ottosson commented Dec 25, 2024

It also seems that adding a window NOT labeled "Main" causes the issue:

  "app": {
    "windows": [
      {
        "width": 800,
        "height": 600,
        "label": "main"
      },
      {
        "width": 800,
        "height": 600,
        "label": "secondary"
      }
    ],
    "security": {
      "csp": null
    }
  }

same if you only have one window not named main. Like main_window as was default in Tauri v1...

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

No branches or pull requests

2 participants