Skip to content

fix: Synchronization issue in FramesTracker#3571

Merged
philipphofmann merged 3 commits into
mainfrom
fix/frames-tracker-sync-issue
Jan 29, 2024
Merged

fix: Synchronization issue in FramesTracker#3571
philipphofmann merged 3 commits into
mainfrom
fix/frames-tracker-sync-issue

Conversation

@philipphofmann

Copy link
Copy Markdown
Member

📜 Description

Synchronize the call to SentryFramesTracker.resetProfilingTimestamps by dispatching it to the main thread cause there is no guarantee that the SDK calls this method on the main thread. Previously, this issue led to crashes in SentryFramesTracker.

💡 Motivation and Context

Fixes GH-3511

💚 How did you test it?

Unit test.

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Synchronize the call to SentryFramesTracker.resetProfilingTimestamps by
dispatching it to the main thread cause there is no guarantee that the
SDK calls this method on the main thread. Previously, this issue led to
crashes in SentryFramesTracker.

Fixes GH-3511
@codecov

codecov Bot commented Jan 23, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (89491ad) 89.262% compared to head (2cc0c08) 89.269%.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #3571       +/-   ##
=============================================
+ Coverage   89.262%   89.269%   +0.006%     
=============================================
  Files          529       529               
  Lines        57716     57752       +36     
  Branches     20653     20669       +16     
=============================================
+ Hits         51519     51555       +36     
- Misses        5287      5288        +1     
+ Partials       910       909        -1     
Files Coverage Δ
Sources/Sentry/SentryDependencyContainer.m 95.330% <100.000%> (+0.018%) ⬆️
Sources/Sentry/SentryFramesTracker.m 100.000% <100.000%> (ø)
...SentryProfilerTests/SentryProfilerSwiftTests.swift 97.739% <100.000%> (ø)
.../AppStartTracking/SentryAppStartTrackerTests.swift 98.511% <100.000%> (ø)
...ance/FramesTracking/SentryFramesTrackerTests.swift 99.166% <100.000%> (+0.025%) ⬆️
...iewController/SentryTimeToDisplayTrackerTest.swift 99.696% <100.000%> (ø)
...ests/SentryTests/Transaction/SentrySpanTests.swift 99.389% <100.000%> (ø)

... and 12 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

@github-actions

github-actions Bot commented Jan 23, 2024

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1231.10 ms 1248.78 ms 17.67 ms
Size 21.58 KiB 418.00 KiB 396.42 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
e324230 1244.43 ms 1252.98 ms 8.55 ms
d760c3f 1200.95 ms 1233.96 ms 33.00 ms
5d6ce0e 1227.57 ms 1241.08 ms 13.51 ms
7cd187e 1223.41 ms 1249.40 ms 26.00 ms
407ff99 1216.63 ms 1235.50 ms 18.87 ms
dc0db9e 1246.06 ms 1260.46 ms 14.40 ms
881a955 1230.98 ms 1246.22 ms 15.24 ms
98cca71 1210.75 ms 1240.64 ms 29.89 ms
9faf217 1268.86 ms 1274.82 ms 5.96 ms
e1eed6b 1224.63 ms 1234.84 ms 10.20 ms

App size

Revision Plain With Sentry Diff
e324230 22.85 KiB 408.88 KiB 386.03 KiB
d760c3f 22.84 KiB 403.17 KiB 380.33 KiB
5d6ce0e 22.85 KiB 405.38 KiB 382.53 KiB
7cd187e 20.76 KiB 401.66 KiB 380.89 KiB
407ff99 20.76 KiB 427.87 KiB 407.10 KiB
dc0db9e 20.76 KiB 419.62 KiB 398.86 KiB
881a955 22.85 KiB 407.63 KiB 384.79 KiB
98cca71 22.85 KiB 411.14 KiB 388.29 KiB
9faf217 20.76 KiB 419.70 KiB 398.94 KiB
e1eed6b 20.76 KiB 432.17 KiB 411.41 KiB

Previous results on branch: fix/frames-tracker-sync-issue

Startup times

Revision Plain With Sentry Diff
4e609e2 1219.94 ms 1236.46 ms 16.52 ms

App size

Revision Plain With Sentry Diff
4e609e2 21.58 KiB 418.04 KiB 396.46 KiB

@brustolin brustolin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

tvOS tests are failing, everything else LGTM

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.

[SentryFramesTracker recordTimestamp:value:array:]

2 participants