Skip to content

Feat/dart default integrations #187

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

Merged
merged 33 commits into from
Nov 28, 2020
Merged

Conversation

rxlabz
Copy link
Contributor

@rxlabz rxlabz commented Nov 25, 2020

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

  • add isolateErrorIntegration and runZoneGuardedIntegration to dart default integrations
  • add an optional initialIntegrations to Sentry.init to allow running custom integrations before runZoneGuardedIntegration

💡 Motivation and Context

💚 How did you test it?

new unit tests

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • All tests passing
  • No breaking changes

🔮 Next steps

@rxlabz rxlabz marked this pull request as ready for review November 25, 2020 14:41
rxlabz and others added 2 commits November 25, 2020 16:00
Co-authored-by: Manoel Aranda Neto <[email protected]>
error,
stackTrace: stackTrace,
);
final sentryId = await Sentry.captureException(error);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the stackTrace: stackTrace removed because error is an Error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was, but now that I put it back, the captureException fails in release mode.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mm, did you figure this out?

Copy link
Contributor Author

@rxlabz rxlabz Nov 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so after investigations :
in browser release mode, capturing the error without adding the stacktrace works, but fails with the optional stacktrace if it is passed as stacktrace, but works if it is passes as String :)

  • this works in web release mode
final sentryId = await Sentry.captureException(
      error,
      stackTrace: stackTrace.toString(),
    );
  • this fails in web release mode
final sentryId = await Sentry.captureException(
      error,
      stackTrace: stackTrace,
    );

Copy link
Contributor

@marandaneto marandaneto Nov 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have an idea why this happens?

we could add a condition like:

stackTrace: (stackTrace != null) ? ((isWeb) ? stackTrace.toString() : stackTrace) : null

adding a comment why of course.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

damn thats problematic, let's fix for Chrome and add a comment for Safari

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as it is it works on Chrome, where would be the better place for a comment ? in the readme ? or StacktraceFactory ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both I'd say, but please create a task for this too, (to research and fix it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rxlabz rxlabz marked this pull request as draft November 26, 2020 16:56
@@ -82,6 +88,8 @@ Future<void> main() async {
} finally {
await Sentry.close();
}

exit(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this if we await the events to be sent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, without it the dart process seems to never end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dart does not end the process or it gets a deadlock somewhere in our SDK? worth checking

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems to be caused by the isolateErrorIntegration

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ I removed the exit call

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the problem still exists or what? just to know if you found out or not

Copy link
Contributor Author

@rxlabz rxlabz Nov 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the problem still exists. it's caused by the isolateErrorIntegration, but didn't found how to fix it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- install flutterErrorIntegration before runZonedGuardedIntegration
@rxlabz rxlabz marked this pull request as ready for review November 27, 2020 12:18
@codecov-io
Copy link

codecov-io commented Nov 28, 2020

Codecov Report

Merging #187 (b4dc147) into main (1214d94) will decrease coverage by 0.57%.
The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #187      +/-   ##
==========================================
- Coverage   78.93%   78.36%   -0.58%     
==========================================
  Files          45       47       +2     
  Lines        1486     1428      -58     
==========================================
- Hits         1173     1119      -54     
+ Misses        313      309       -4     
Impacted Files Coverage Δ
dart/lib/src/sentry_stack_trace_factory.dart 95.65% <ø> (ø)
dart/lib/src/utils.dart 100.00% <ø> (ø)
flutter/lib/src/platform_checker.dart 0.00% <0.00%> (ø)
dart/lib/src/isolate_error_integration.dart 87.50% <87.50%> (ø)
dart/lib/src/default_integrations.dart 100.00% <100.00%> (ø)
dart/lib/src/sentry.dart 77.35% <100.00%> (+6.90%) ⬆️
flutter/lib/src/sentry_flutter.dart 76.31% <100.00%> (-0.43%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1214d94...b4dc147. Read the comment docs.

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

Successfully merging this pull request may close these issues.

3 participants