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

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

Open buenaflor opened this issue 1 year ago • 4 comments

:scroll: Description

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

let's check if 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

  • [ ] I reviewed submitted code
  • [ ] I added tests to verify changes
  • [ ] No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • [ ] I updated the docs if needed
  • [ ] All tests passing
  • [ ] No breaking changes

:crystal_ball: Next steps

buenaflor avatar Jun 06 '24 15:06 buenaflor

Codecov Report

Attention: Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.00%. Comparing base (07351da) to head (d23edf9). Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
dart/lib/src/sentry_run_zoned_guarded.dart 92.85% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2088      +/-   ##
==========================================
+ Coverage   86.85%   87.00%   +0.15%     
==========================================
  Files         260      261       +1     
  Lines        9242     9249       +7     
==========================================
+ Hits         8027     8047      +20     
+ Misses       1215     1202      -13     

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

codecov[bot] avatar Jun 06 '24 15:06 codecov[bot]

Android Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 423.29 ms 477.35 ms 54.06 ms
Size 6.49 MiB 7.56 MiB 1.07 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
affcf078275df70b443b3150a5ae60951bfa5faa 446.19 ms 476.32 ms 30.13 ms
2331d89055c421463574e68889d9ee24e7c15e32 352.45 ms 417.34 ms 64.89 ms
7fd33d3c2d5031fdeac6238b356f51f8445ec11e 452.90 ms 506.75 ms 53.85 ms
f9d18f3411c23172de9bbb769b49dae01834f5e6 430.94 ms 497.59 ms 66.65 ms
af2d175c1ac16ff4cfdb9504c013db825fe9b436 279.08 ms 312.37 ms 33.29 ms
3334ac176f15a6d39b435960620ea9a4919aae79 303.98 ms 366.65 ms 62.67 ms
c732386ce5f372225fe638c1ded8d02c6e04a8fd 316.84 ms 390.62 ms 73.78 ms
e82709a24504959ed7fe9b79ba3f038a31b6c5db 361.18 ms 423.50 ms 62.32 ms
5baa2016731c3fe306570ee40d6f18206cf63791 389.26 ms 462.83 ms 73.57 ms
03e4c9b6af66673bdc361ac0231ab682c8d374fe 410.34 ms 493.20 ms 82.86 ms

App size

Revision Plain With Sentry Diff
affcf078275df70b443b3150a5ae60951bfa5faa 6.52 MiB 7.59 MiB 1.06 MiB
2331d89055c421463574e68889d9ee24e7c15e32 5.94 MiB 6.96 MiB 1.02 MiB
7fd33d3c2d5031fdeac6238b356f51f8445ec11e 6.49 MiB 7.56 MiB 1.08 MiB
f9d18f3411c23172de9bbb769b49dae01834f5e6 6.15 MiB 7.13 MiB 1000.49 KiB
af2d175c1ac16ff4cfdb9504c013db825fe9b436 5.94 MiB 6.92 MiB 1001.83 KiB
3334ac176f15a6d39b435960620ea9a4919aae79 6.06 MiB 7.03 MiB 993.54 KiB
c732386ce5f372225fe638c1ded8d02c6e04a8fd 6.26 MiB 7.20 MiB 958.78 KiB
e82709a24504959ed7fe9b79ba3f038a31b6c5db 6.34 MiB 7.29 MiB 970.37 KiB
5baa2016731c3fe306570ee40d6f18206cf63791 6.35 MiB 7.33 MiB 1005.56 KiB
03e4c9b6af66673bdc361ac0231ab682c8d374fe 6.35 MiB 7.42 MiB 1.07 MiB

Previous results on branch: fix/runzoneguarded

Startup times

Revision Plain With Sentry Diff
28227649a96174585e694329cfffec0465963137 455.45 ms 496.37 ms 40.92 ms
3f0f7d9ac3ea6068e9699f9d3f86fbe8bd05ea38 529.37 ms 585.55 ms 56.18 ms
20261fb67df3d1fa6cad374ddd5580c8d59df6fe 444.80 ms 506.02 ms 61.22 ms
ff275ca6f04bc0a1800433536cd141c51a9b8271 503.47 ms 564.47 ms 61.00 ms
2ef2edf282cfd9ccbfbf7effde9180a97f8cfb08 626.36 ms 693.30 ms 66.94 ms
321b584f88da24ecad61be2fcfec8385df150b52 415.48 ms 468.86 ms 53.38 ms
b8b75a76f660a927277df95f86bea5c3a7a9224c 448.68 ms 490.80 ms 42.12 ms
4b1e6c71e626c8533f8d3eed3fa70623fc2bbbc0 468.25 ms 519.58 ms 51.33 ms
4b77b4192454b79e41878760011f99826ecb868e 478.64 ms 535.36 ms 56.72 ms
6634f0d9fc5a2f5adab1d32beaee43a9f4eadf12 459.17 ms 520.98 ms 61.81 ms

App size

Revision Plain With Sentry Diff
28227649a96174585e694329cfffec0465963137 6.49 MiB 7.56 MiB 1.07 MiB
3f0f7d9ac3ea6068e9699f9d3f86fbe8bd05ea38 6.49 MiB 7.56 MiB 1.07 MiB
20261fb67df3d1fa6cad374ddd5580c8d59df6fe 6.49 MiB 7.56 MiB 1.07 MiB
ff275ca6f04bc0a1800433536cd141c51a9b8271 6.49 MiB 7.56 MiB 1.07 MiB
2ef2edf282cfd9ccbfbf7effde9180a97f8cfb08 6.49 MiB 7.56 MiB 1.07 MiB
321b584f88da24ecad61be2fcfec8385df150b52 6.49 MiB 7.56 MiB 1.07 MiB
b8b75a76f660a927277df95f86bea5c3a7a9224c 6.49 MiB 7.56 MiB 1.08 MiB
4b1e6c71e626c8533f8d3eed3fa70623fc2bbbc0 6.49 MiB 7.56 MiB 1.07 MiB
4b77b4192454b79e41878760011f99826ecb868e 6.49 MiB 7.56 MiB 1.07 MiB
6634f0d9fc5a2f5adab1d32beaee43a9f4eadf12 6.49 MiB 7.56 MiB 1.07 MiB

github-actions[bot] avatar Jun 06 '24 15:06 github-actions[bot]

iOS Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 1260.76 ms 1284.04 ms 23.29 ms
Size 8.38 MiB 9.78 MiB 1.40 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
90a08ea59ea9a5f3aed6058b400411496b29aa91 1260.45 ms 1285.24 ms 24.80 ms
e239c830ce5177e7392e665600b16745141b4762 1248.40 ms 1269.28 ms 20.89 ms
c9d3212f2912cb01a1648be804a482edeee6b791 1231.84 ms 1237.40 ms 5.57 ms
6aab859f42bd361abd466a8fdfb0ddcaf7f8cca4 1245.14 ms 1247.59 ms 2.45 ms
e0f3acf4c1ce582e54425e5e1261cef7bf6bb190 1238.21 ms 1263.54 ms 25.34 ms
f3a18f2c0b10fa183006697281d9c59440dc6cc6 1246.86 ms 1268.00 ms 21.14 ms
04bd9e665bd9e8a5f2d1b16c55e4e3fdd18f9b6d 1230.78 ms 1250.71 ms 19.94 ms
5aba4171c641227176fb08f4a73fc95f620c4a42 1265.31 ms 1287.90 ms 22.59 ms
64af39c26c91cb82e402c65852a0e6abdd890f53 1243.98 ms 1257.69 ms 13.71 ms
5603ab240ccb170067baf128345a92757ee5de64 1268.47 ms 1280.73 ms 12.26 ms

App size

Revision Plain With Sentry Diff
90a08ea59ea9a5f3aed6058b400411496b29aa91 8.38 MiB 9.73 MiB 1.36 MiB
e239c830ce5177e7392e665600b16745141b4762 8.38 MiB 9.74 MiB 1.36 MiB
c9d3212f2912cb01a1648be804a482edeee6b791 8.29 MiB 9.39 MiB 1.10 MiB
6aab859f42bd361abd466a8fdfb0ddcaf7f8cca4 8.29 MiB 9.36 MiB 1.07 MiB
e0f3acf4c1ce582e54425e5e1261cef7bf6bb190 8.38 MiB 9.78 MiB 1.40 MiB
f3a18f2c0b10fa183006697281d9c59440dc6cc6 8.38 MiB 9.75 MiB 1.37 MiB
04bd9e665bd9e8a5f2d1b16c55e4e3fdd18f9b6d 8.33 MiB 9.61 MiB 1.27 MiB
5aba4171c641227176fb08f4a73fc95f620c4a42 8.16 MiB 9.17 MiB 1.01 MiB
64af39c26c91cb82e402c65852a0e6abdd890f53 8.28 MiB 9.34 MiB 1.06 MiB
5603ab240ccb170067baf128345a92757ee5de64 8.15 MiB 9.12 MiB 990.57 KiB

Previous results on branch: fix/runzoneguarded

Startup times

Revision Plain With Sentry Diff
cc0cedd0db0ffe1d46c3a4d77a27bb749ad1e2ad 1263.18 ms 1289.23 ms 26.04 ms
b8b75a76f660a927277df95f86bea5c3a7a9224c 1261.64 ms 1273.83 ms 12.19 ms
20261fb67df3d1fa6cad374ddd5580c8d59df6fe 1251.88 ms 1279.57 ms 27.69 ms
2ef2edf282cfd9ccbfbf7effde9180a97f8cfb08 1245.10 ms 1274.41 ms 29.31 ms
6634f0d9fc5a2f5adab1d32beaee43a9f4eadf12 1252.96 ms 1288.66 ms 35.70 ms
4b77b4192454b79e41878760011f99826ecb868e 1249.47 ms 1278.40 ms 28.93 ms
28227649a96174585e694329cfffec0465963137 1244.98 ms 1274.42 ms 29.44 ms
ff275ca6f04bc0a1800433536cd141c51a9b8271 1255.73 ms 1281.53 ms 25.80 ms
321b584f88da24ecad61be2fcfec8385df150b52 1242.79 ms 1273.15 ms 30.36 ms
4b1e6c71e626c8533f8d3eed3fa70623fc2bbbc0 1250.65 ms 1268.02 ms 17.38 ms

App size

Revision Plain With Sentry Diff
cc0cedd0db0ffe1d46c3a4d77a27bb749ad1e2ad 8.38 MiB 9.78 MiB 1.40 MiB
b8b75a76f660a927277df95f86bea5c3a7a9224c 8.38 MiB 9.78 MiB 1.40 MiB
20261fb67df3d1fa6cad374ddd5580c8d59df6fe 8.38 MiB 9.78 MiB 1.40 MiB
2ef2edf282cfd9ccbfbf7effde9180a97f8cfb08 8.38 MiB 9.78 MiB 1.40 MiB
6634f0d9fc5a2f5adab1d32beaee43a9f4eadf12 8.38 MiB 9.78 MiB 1.40 MiB
4b77b4192454b79e41878760011f99826ecb868e 8.38 MiB 9.77 MiB 1.39 MiB
28227649a96174585e694329cfffec0465963137 8.38 MiB 9.78 MiB 1.40 MiB
ff275ca6f04bc0a1800433536cd141c51a9b8271 8.38 MiB 9.78 MiB 1.40 MiB
321b584f88da24ecad61be2fcfec8385df150b52 8.38 MiB 9.78 MiB 1.40 MiB
4b1e6c71e626c8533f8d3eed3fa70623fc2bbbc0 8.38 MiB 9.78 MiB 1.40 MiB

github-actions[bot] avatar Jun 06 '24 15:06 github-actions[bot]

@denrase also pls prepare docs for this

buenaflor avatar Nov 28 '24 20:11 buenaflor