getsentry / sentry-dart

Sentry SDK for Dart and Flutter
https://sentry.io/for/flutter/
MIT License
747 stars 233 forks source link

Trying to render a disposed EngineFlutterView #2325

Open markbeij opened 11 hours ago

markbeij commented 11 hours ago

Platform

Flutter Web

Obfuscation

Disabled

Debug Info

Disabled

Doctor

[√] Flutter (Channel stable, 3.24.2, on Microsoft Windows [Version 10.0.22631.4169], locale nl-NL) • Flutter version 3.24.2 on channel stable at C:\DEV\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 4cf269e36d (4 weeks ago), 2024-09-03 14:30:00 -0700 • Engine revision a6bd3f1de1 • Dart version 3.5.2 • DevTools version 2.37.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at C:\Users\someuser\AppData\Local\Android\sdk • Platform android-34, build-tools 34.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231) • All Android licenses accepted.

[√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.37) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools • Visual Studio Build Tools 2019 version 16.11.34931.43 • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.3) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.93.1) • VS Code at C:\Users\someuser\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.96.0

[√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.4169] • Chrome (web) • chrome • web-javascript • Google Chrome 129.0.6668.70 • Edge (web) • edge • web-javascript • Microsoft Edge 127.0.2651.105

[√] Network resources • All expected network resources are available.

• No issues found!

Version

8.9.0

Steps to Reproduce

  1. flutter create --platforms web sentrypoc
  2. add sentry_flutter: ^8.9.0
  3. add sentry_logging: ^8.9.0
  4. Replace main with```dartvoid main() async { await SentryFlutter.init((options) { options.dsn = 'https://abc@123.ingest.de.sentry.io/4507934763909200'; }); runApp(const MyApp()); }
  5. Set breakpoint on runApp
  6. Run the app and wait untill breakpoint gets hit
  7. Press Restart

Expected Result

App restarts without issues

Actual Result

estarted application in 451ms.
══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
The following assertion was thrown during a scheduler callback:
Assertion failed: org-dartlang-sdk:///lib/_engine/engine/window.dart:102:12
!isDisposed
"Trying to render a disposed EngineFlutterView."

When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 296:3     throw_
errors.dart:296
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 29:3      assertFailed
errors.dart:29
lib/_engine/engine/window.dart 102:13                                           render
window.dart:102
packages/flutter/src/rendering/view.dart 353:7                                  compositeFrame
view.dart:353
packages/flutter/src/rendering/binding.dart 607:19                              drawFrame
binding.dart:607
packages/flutter/src/widgets/binding.dart 1164:13                               drawFrame
binding.dart:1164
packages/flutter/src/rendering/binding.dart 468:5                               [_handlePersistentFrameCallback]
binding.dart:468
packages/flutter/src/scheduler/binding.dart 1397:7                              [_invokeFrameCallback]
binding.dart:1397
packages/flutter/src/scheduler/binding.dart 1318:9                              handleDrawFrame
binding.dart:1318
packages/flutter/src/scheduler/binding.dart 1176:5                              [_handleDrawFrame]
binding.dart:1176
lib/_engine/engine/platform_dispatcher.dart 1408:5                              invoke
platform_dispatcher.dart:1408
lib/_engine/engine/platform_dispatcher.dart 310:5                               invokeOnDrawFrame
platform_dispatcher.dart:310
lib/_engine/engine/initialization.dart 187:36                                   <fn>
initialization.dart:187
dart-sdk/lib/_internal/js_dev_runtime/patch/js_allow_interop_patch.dart 188:27  _callDartFunctionFast1
js_allow_interop_patch.dart:188
════════════════════════════════════════════════════════════════════════════════════════════════════

Are you willing to submit a PR?

None

buenaflor commented 4 hours ago

hey, is this issue blocking you from using Sentry?

markbeij commented 4 hours ago

hey, is this issue blocking you from using Sentry?

Yes it is blocking because I can't oversee the impact of this. I'm not sure if the issue is bigger than just restarting the debugger throws an exception. Workaround would be to bypass initialisation of Sentry when in debug mode, but we prefer using the same code for debug and release mode as much as possible.

buenaflor commented 3 hours ago

got it, @markbeij we'll have a look 👍