Skip to content

Conversation

denrase
Copy link
Collaborator

@denrase denrase commented Sep 23, 2025

📜 Description

Mark file sync spans run in the main isolate with blocked_main_thread

  • Add spans for file sync oeration accros plugins: hive, isar, file
  • Add new event 'OnSpanFinish'
  • enrich in thread info integration if sync file access on main

💡 Motivation and Context

Closes #1727

💚 How did you test it?

Unit tests

📝 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

Copy link

codecov bot commented Sep 23, 2025

Codecov Report

❌ Patch coverage is 92.13483% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.52%. Comparing base (8541716) to head (55214b3).

Files with missing lines Patch % Lines
packages/isar/lib/src/sentry_isar.dart 69.56% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3270      +/-   ##
==========================================
- Coverage   87.84%   87.52%   -0.33%     
==========================================
  Files         290      195      -95     
  Lines       10003     6683    -3320     
==========================================
- Hits         8787     5849    -2938     
+ Misses       1216      834     -382     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Sep 23, 2025

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 447.58 ms 443.88 ms -3.70 ms
Size 13.93 MiB 15.00 MiB 1.06 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
192b44c 472.26 ms 477.34 ms 5.08 ms
6ba4675 499.80 ms 632.43 ms 132.63 ms
575ebaa 478.00 ms 585.76 ms 107.76 ms
e45c0e1 447.29 ms 558.33 ms 111.04 ms
79f6b41 469.66 ms 525.90 ms 56.24 ms
8825ed8 447.65 ms 456.90 ms 9.25 ms
eca355d 485.50 ms 569.85 ms 84.35 ms
93b7728 475.28 ms 489.13 ms 13.86 ms
765aa8b 493.51 ms 531.23 ms 37.72 ms
73dca78 476.53 ms 522.21 ms 45.68 ms

App size

Revision Plain With Sentry Diff
192b44c 13.93 MiB 14.93 MiB 1.00 MiB
6ba4675 6.54 MiB 7.53 MiB 1015.26 KiB
575ebaa 6.54 MiB 7.69 MiB 1.15 MiB
e45c0e1 6.54 MiB 7.70 MiB 1.16 MiB
79f6b41 6.54 MiB 7.69 MiB 1.15 MiB
8825ed8 13.93 MiB 14.93 MiB 1.00 MiB
eca355d 6.54 MiB 7.70 MiB 1.16 MiB
93b7728 6.54 MiB 7.69 MiB 1.15 MiB
765aa8b 6.54 MiB 7.70 MiB 1.16 MiB
73dca78 6.54 MiB 7.69 MiB 1.15 MiB

Previous results on branch: enha/mark-scncy-method-spans-on-main-isolate

Startup times

Revision Plain With Sentry Diff
cd6efd2 503.06 ms 493.85 ms -9.21 ms
d005357 437.94 ms 470.70 ms 32.76 ms
f4d9e3a 487.98 ms 478.63 ms -9.35 ms

App size

Revision Plain With Sentry Diff
cd6efd2 13.93 MiB 15.00 MiB 1.06 MiB
d005357 13.93 MiB 15.00 MiB 1.06 MiB
f4d9e3a 13.93 MiB 15.00 MiB 1.06 MiB

Copy link
Contributor

github-actions bot commented Sep 23, 2025

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1261.92 ms 1263.49 ms 1.57 ms
Size 5.53 MiB 6.00 MiB 481.94 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
793f4dc 1262.50 ms 1282.35 ms 19.85 ms
5b9a0da 1249.69 ms 1250.71 ms 1.03 ms
575ebaa 1262.20 ms 1274.24 ms 12.04 ms
eca355d 1238.39 ms 1266.98 ms 28.59 ms
9b99523 1256.06 ms 1270.33 ms 14.27 ms
e2d675d 1238.48 ms 1242.76 ms 4.28 ms
32914d8 1275.47 ms 1285.20 ms 9.73 ms
79f6b41 1269.33 ms 1279.71 ms 10.38 ms
cc4e375 1253.06 ms 1263.81 ms 10.75 ms
de377fd 1252.28 ms 1254.76 ms 2.48 ms

App size

Revision Plain With Sentry Diff
793f4dc 7.86 MiB 9.44 MiB 1.58 MiB
5b9a0da 5.53 MiB 5.96 MiB 444.32 KiB
575ebaa 7.86 MiB 9.44 MiB 1.58 MiB
eca355d 7.86 MiB 9.44 MiB 1.58 MiB
9b99523 7.86 MiB 9.44 MiB 1.58 MiB
e2d675d 7.86 MiB 9.44 MiB 1.58 MiB
32914d8 7.86 MiB 9.44 MiB 1.58 MiB
79f6b41 7.86 MiB 9.44 MiB 1.58 MiB
cc4e375 7.86 MiB 9.44 MiB 1.58 MiB
de377fd 20.71 MiB 22.43 MiB 1.73 MiB

Previous results on branch: enha/mark-scncy-method-spans-on-main-isolate

Startup times

Revision Plain With Sentry Diff
cd6efd2 1253.13 ms 1256.17 ms 3.03 ms
f4d9e3a 1256.13 ms 1249.04 ms -7.08 ms

App size

Revision Plain With Sentry Diff
cd6efd2 5.53 MiB 6.00 MiB 481.93 KiB
f4d9e3a 5.53 MiB 6.00 MiB 481.93 KiB

@denrase denrase marked this pull request as ready for review September 24, 2025 08:10
cursor[bot]

This comment was marked as outdated.

span?.finish();

// ignore: invalid_use_of_internal_member
_hub.scope.addBreadcrumb(breadcrumb);
Copy link

Choose a reason for hiding this comment

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

Bug: Async Operations in Finally Block

In syncWrapInSpan, span?.finish() and _hub.scope.addBreadcrumb() are async operations called without await in the finally block. This can lead to incomplete span finalization, unhandled exceptions, and race conditions, as these operations may not complete before the method returns. This applies to both Hive and Isar.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

File sync run in the main isolate for a certain amount of time should report as a performance issue
1 participant