getsentry / sentry-dart

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

Reported issues don't not have app-specific error details #2217

Closed ekuleshov closed 2 months ago

ekuleshov commented 3 months ago

Platform

Flutter Mobile

Obfuscation

Disabled

Debug Info

Disabled

Doctor

[✓] Flutter (Channel stable, 3.22.3, on macOS 13.6.6 22G630 darwin-arm64, locale en-CA)
    • Flutter version 3.22.3 on channel stable at ***
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b0850beeb2 (3 weeks ago), 2024-07-16 21:43:41 -0700
    • Engine revision 235db911ba
    • Dart version 3.4.4
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/eu/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode_15.2.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.4)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 80.0.2
    • Dart plugin version 241.18808

[✓] Connected device (3 available)            
    • macOS (desktop)                 • macos                 • darwin-arm64   • macOS 13.6.6 22G630 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 13.6.6 22G630 darwin-arm64
    • Chrome (web)                    • chrome                • web-javascript • Google Chrome 127.0.6533.89

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

Version

8.6.0

Steps to Reproduce

Sentry is configured to capture exceptions. This is the issue and a complete stack trace I'm getting from the Sentry's error handler, which has next to nothing info about the actual error.

SocketException: SocketException: Connection reset by peer (OS Error: Connection reset by peer, errno = 104), address = 192.168.97.168, port = 58966
  #0      getCurrentStackTrace (package:sentry/src/utils/stacktrace_utils.dart:10)
  #1      OnErrorIntegration.call.<fn> (package:sentry_flutter/src/integrations/on_error_integration.dart:82)
  #2      PlatformDispatcher._dispatchError (dart:ui/platform_dispatcher.dart:1302)
  #3      _onError (dart:ui/hooks.dart:288)

Expected Result

The reported stack trace should have enough info about the actual issues.

Actual Result

The reported stacktrace is not relevant to the app's issue and has references to Sentry's own code.

Are you willing to submit a PR?

None

buenaflor commented 3 months ago

hi we have multiple onError handlers from which the flutter framework reports errors, but some errors that we receive directly from the framework don't have a stacktrace attached so we try to capture it ourselves with a Stacktrace.current. that's why you see getCurrentStackTrace at the very top.

And it seems like this is in some cases not sufficient enough/doesn't give enough context, in your case it was the PlatformDispatcher which should report platform-level errors so maybe that's why Stacktrace.current doesn't make much sense.

You could also send your event link to giancarlo.buenaflor@sentry.io (this is my email) so I can take a closer look

buenaflor commented 3 months ago

related: https://github.com/flutter/flutter/issues/30007

ekuleshov commented 3 months ago

I nailed it down to https://github.com/dart-lang/sdk/issues/56431

buenaflor commented 2 months ago

Closing this as it'll be fixed by https://dart-review.googlesource.com/c/sdk/+/380982