getsentry / sentry-dart

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

[draft] fix(web): don't create runZoneGuarded on web if it already exists #2088

Open buenaflor opened 2 weeks ago

buenaflor commented 2 weeks ago

:scroll: Description

If the sentry init is already set up in a zone, don't create another one internally

We can still keep the onError callback and propagate the user's onError on top of it so we can keep the original behaviour

:bulb: Motivation and Context

Fixes https://github.com/getsentry/sentry-dart/issues/1943

:green_heart: How did you test it?

:pencil: Checklist

:crystal_ball: Next steps

github-actions[bot] commented 2 weeks ago
Fails
:no_entry_sign: Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- don't create runZoneGuarded on web if it already exists ([#2088](https://github.com/getsentry/sentry-dart/pull/2088))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by :no_entry_sign: dangerJS against f6fa1acddf72634e40b6ffefd778f9a55cd3df2f

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.

Project coverage is 92.45%. Comparing base (99b37a6) to head (f6fa1ac).

Files Patch % Lines
flutter/lib/src/sentry_flutter.dart 57.14% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2088 +/- ## ========================================== + Coverage 88.64% 92.45% +3.81% ========================================== Files 223 61 -162 Lines 7583 1922 -5661 ========================================== - Hits 6722 1777 -4945 + Misses 861 145 -716 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 2 weeks ago

Android Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 399.60 ms 545.88 ms 146.27 ms
Size 6.35 MiB 7.34 MiB 1008.55 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0f067d38500c0ab6b9e85d0b19690ba915d4fea1 359.56 ms 431.28 ms 71.72 ms
4b943a1ac1698fd9bd8c8fb87aad3d13cf713ebb 348.17 ms 437.15 ms 88.98 ms
5aba4171c641227176fb08f4a73fc95f620c4a42 355.78 ms 450.39 ms 94.61 ms
b0811ccc76dccb91004b36b5f710163daf733d92 580.00 ms 675.69 ms 95.69 ms
04db237c887e97fd4e5843a50e97135e2e03ce53 330.16 ms 428.38 ms 98.22 ms
c732386ce5f372225fe638c1ded8d02c6e04a8fd 316.84 ms 390.62 ms 73.78 ms
74e1fdd2ec34816cd8eedefc833dccc7d3baa2c5 398.61 ms 418.43 ms 19.82 ms
453e1bca2bc18a0a639cc7f796ed58c7c44d89b7 320.41 ms 372.73 ms 52.32 ms
051e97a45b67f5c431e8c540585c1786c42670f9 359.56 ms 426.68 ms 67.12 ms
6fedcab9f494397bd4e1d450b5423f074c63fd82 388.26 ms 487.42 ms 99.16 ms

App size

Revision Plain With Sentry Diff
0f067d38500c0ab6b9e85d0b19690ba915d4fea1 6.33 MiB 7.30 MiB 992.08 KiB
4b943a1ac1698fd9bd8c8fb87aad3d13cf713ebb 6.34 MiB 7.28 MiB 968.41 KiB
5aba4171c641227176fb08f4a73fc95f620c4a42 5.94 MiB 6.96 MiB 1.02 MiB
b0811ccc76dccb91004b36b5f710163daf733d92 6.33 MiB 7.27 MiB 954.02 KiB
04db237c887e97fd4e5843a50e97135e2e03ce53 5.94 MiB 6.95 MiB 1.01 MiB
c732386ce5f372225fe638c1ded8d02c6e04a8fd 6.26 MiB 7.20 MiB 958.78 KiB
74e1fdd2ec34816cd8eedefc833dccc7d3baa2c5 6.33 MiB 7.27 MiB 954.12 KiB
453e1bca2bc18a0a639cc7f796ed58c7c44d89b7 5.94 MiB 6.95 MiB 1.01 MiB
051e97a45b67f5c431e8c540585c1786c42670f9 6.27 MiB 7.20 MiB 959.09 KiB
6fedcab9f494397bd4e1d450b5423f074c63fd82 6.33 MiB 7.30 MiB 987.83 KiB

Previous results on branch: fix/runzoneguarded

Startup times

Revision Plain With Sentry Diff
34ea13996716e37f7524010d6a112826c1c72268 393.15 ms 462.71 ms 69.57 ms

App size

Revision Plain With Sentry Diff
34ea13996716e37f7524010d6a112826c1c72268 6.35 MiB 7.33 MiB 1005.84 KiB
github-actions[bot] commented 2 weeks ago

iOS Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 1227.00 ms 1249.88 ms 22.88 ms
Size 8.33 MiB 9.60 MiB 1.27 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
04bd9e665bd9e8a5f2d1b16c55e4e3fdd18f9b6d 1230.78 ms 1250.71 ms 19.94 ms
25161f47b02abb67b61b15fa4b63028dc5298069 1252.35 ms 1263.84 ms 11.49 ms
4656f10b89fe70667fd5807037fedc9550a54d73 1247.04 ms 1276.16 ms 29.12 ms
abcdba32324a0963ec44af1537d4444dac1699d3 1257.31 ms 1283.49 ms 26.18 ms
2966d88d828c6e2604b15b95f0d0d958acc2cc68 1251.76 ms 1270.21 ms 18.46 ms
333903e1f27adf13ed2ebf30932a74ee2bc5aebf 1251.15 ms 1270.21 ms 19.06 ms
2a0edbaed1f13657658cda07ae7b9135fa37d745 1229.27 ms 1259.54 ms 30.27 ms
89ea268a7f626fd1b23c6ffa55ec68da030ea450 1252.33 ms 1253.58 ms 1.26 ms
50bdfad10c3833c388a7a32c883117f3e9b2cbce 1253.14 ms 1274.54 ms 21.40 ms
5aba4171c641227176fb08f4a73fc95f620c4a42 1265.31 ms 1287.90 ms 22.59 ms

App size

Revision Plain With Sentry Diff
04bd9e665bd9e8a5f2d1b16c55e4e3fdd18f9b6d 8.33 MiB 9.61 MiB 1.27 MiB
25161f47b02abb67b61b15fa4b63028dc5298069 8.28 MiB 9.34 MiB 1.06 MiB
4656f10b89fe70667fd5807037fedc9550a54d73 8.32 MiB 9.50 MiB 1.19 MiB
abcdba32324a0963ec44af1537d4444dac1699d3 8.15 MiB 9.12 MiB 989.76 KiB
2966d88d828c6e2604b15b95f0d0d958acc2cc68 8.32 MiB 9.38 MiB 1.06 MiB
333903e1f27adf13ed2ebf30932a74ee2bc5aebf 8.10 MiB 9.16 MiB 1.06 MiB
2a0edbaed1f13657658cda07ae7b9135fa37d745 8.32 MiB 9.52 MiB 1.20 MiB
89ea268a7f626fd1b23c6ffa55ec68da030ea450 8.09 MiB 9.16 MiB 1.06 MiB
50bdfad10c3833c388a7a32c883117f3e9b2cbce 8.32 MiB 9.43 MiB 1.10 MiB
5aba4171c641227176fb08f4a73fc95f620c4a42 8.16 MiB 9.17 MiB 1.01 MiB

Previous results on branch: fix/runzoneguarded

Startup times

Revision Plain With Sentry Diff
34ea13996716e37f7524010d6a112826c1c72268 1245.20 ms 1262.00 ms 16.80 ms

App size

Revision Plain With Sentry Diff
34ea13996716e37f7524010d6a112826c1c72268 8.33 MiB 9.54 MiB 1.22 MiB