sentry-dart icon indicating copy to clipboard operation
sentry-dart copied to clipboard

Implement exception groups

Open krystofwoldrich opened this issue 1 year ago • 5 comments

Description

The Dart/Flutter SDK currently supports PlatformExceptions and ExceptionCause.

Related links

  • https://github.com/getsentry/sentry-dart/blob/681136bc4576771f144f52c7209c03ce3ace88bb/flutter/lib/src/event_processor/platform_exception_event_processor.dart#L5
  • https://github.com/getsentry/sentry-dart/blob/681136bc4576771f144f52c7209c03ce3ace88bb/dart/lib/src/exception_cause_extractor.dart#L32
  • Sentry RFC https://github.com/getsentry/rfcs/blob/main/text/0079-exception-groups.md#example-event
  • Example JS impl https://github.com/getsentry/sentry-javascript/pull/8463

Notes

  • ~I'm not aware of how used or not the AggregateErrors are. After a quick search doesn't seem too common.~
  • Implementing this might likely change grouping so it should be done in a major version.
  • Dart could add the parent-child relationship to the linked errors as described in the RFC.
### Blocked by
- [ ] https://github.com/getsentry/sentry/issues/64088
- [ ] https://github.com/getsentry/sentry-java/pull/3184

krystofwoldrich avatar Feb 05 '24 10:02 krystofwoldrich

This is coming out of a package and it's not an error from Dart or Flutter. The package is also not particularly popular.

ueman avatar Feb 05 '24 10:02 ueman

@ueman Thank you for the message, I've missed that, in that case, it doesn't make sense to add it to the SDK.

We could still add the parent-child relationship for the PlatformExceptions and Cause as described in the RFC.

krystofwoldrich avatar Feb 05 '24 15:02 krystofwoldrich

After a closer look, it looks like the dart SDK is sending the native and dart exceptions in the opposite order than the specification says.

Dart send: Newer -> older. (Dart -> native) -> https://github.com/getsentry/sentry-dart/blob/8e4eeb39d082dd70fa42619dcf4b4e8d54801a46/flutter/lib/src/event_processor/android_platform_exception_event_processor.dart#L100-L101 Specs: Older -> newer. -> https://develop.sentry.dev/sdk/event-payloads/exception/

krystofwoldrich avatar Feb 05 '24 15:02 krystofwoldrich

After a closer look, it looks like the dart SDK is sending the native and dart exceptions in the opposite order than the specification says.

Dart send: Newer -> older. (Dart -> native) ->

https://github.com/getsentry/sentry-dart/blob/8e4eeb39d082dd70fa42619dcf4b4e8d54801a46/flutter/lib/src/event_processor/android_platform_exception_event_processor.dart#L100-L101

Specs: Older -> newer. -> develop.sentry.dev/sdk/event-payloads/exception

Be sure before changing the order, I know that the BE reverses the list.

marandaneto avatar Feb 06 '24 15:02 marandaneto

@marandaneto Thank you I will check that, don't want to break it.

krystofwoldrich avatar Feb 08 '24 13:02 krystofwoldrich