Skip to content

Conversation

philipphofmann
Copy link
Member

📜 Description

Although the name for setMeasurement is nonnull, we saw occurrences when it was nil, which led to crashes. Now, when the name is nil, the SDK discards the measurement and logs an error.

💡 Motivation and Context

A customer reported these crashes.

💚 How did you test it?

Unit tests

📝 Checklist

You have to check all boxes before merging:

  • 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.
  • I updated the wizard 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.

Although the name for setMeasurement is nonnull, we saw occurrences when
it was nil, which led to crashes. Now, when the name is nil, the SDK
discards the measurement and logs an error.
@codecov
Copy link

codecov bot commented Apr 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.729%. Comparing base (9c3c8d5) to head (797eb72).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #5064       +/-   ##
=============================================
- Coverage   92.731%   92.729%   -0.002%     
=============================================
  Files          674       675        +1     
  Lines        83552     83629       +77     
  Branches     30451     30480       +29     
=============================================
+ Hits         77479     77549       +70     
- Misses        5976      5980        +4     
- Partials        97       100        +3     
Files with missing lines Coverage Δ
Sources/Sentry/SentryTracer.m 97.631% <100.000%> (+0.036%) ⬆️
Tests/SentryTests/Transaction/SentryTracer+Test.m 100.000% <100.000%> (ø)
...ts/SentryTests/Transaction/SentryTracerTests.swift 99.418% <100.000%> (+0.024%) ⬆️

... and 11 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 9c3c8d5...797eb72. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@philprime philprime left a comment

Choose a reason for hiding this comment

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

LGTM, left some comments

@github-actions
Copy link
Contributor

github-actions bot commented Apr 8, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1223.76 ms 1254.88 ms 31.12 ms
Size 22.30 KiB 846.07 KiB 823.77 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
6164c67 1219.02 ms 1231.38 ms 12.35 ms
596ccc1 1230.85 ms 1244.24 ms 13.39 ms
253bb71 1221.62 ms 1250.82 ms 29.20 ms
c59914b 1342.08 ms 1375.73 ms 33.65 ms
ebfe678 1234.63 ms 1254.52 ms 19.89 ms
9ce54cc 1230.31 ms 1237.20 ms 6.90 ms
0a12181 1231.37 ms 1248.13 ms 16.75 ms
7bbb7c3 1232.40 ms 1249.78 ms 17.38 ms
3cba0e8 1243.04 ms 1257.46 ms 14.42 ms
c0ea6a1 1236.42 ms 1250.94 ms 14.52 ms

App size

Revision Plain With Sentry Diff
6164c67 21.58 KiB 681.72 KiB 660.14 KiB
596ccc1 22.84 KiB 401.44 KiB 378.60 KiB
253bb71 20.76 KiB 393.37 KiB 372.60 KiB
c59914b 21.58 KiB 671.90 KiB 650.32 KiB
ebfe678 22.31 KiB 775.27 KiB 752.95 KiB
9ce54cc 21.58 KiB 573.71 KiB 552.13 KiB
0a12181 21.58 KiB 419.20 KiB 397.61 KiB
7bbb7c3 21.58 KiB 418.78 KiB 397.20 KiB
3cba0e8 22.84 KiB 403.19 KiB 380.34 KiB
c0ea6a1 21.58 KiB 671.94 KiB 650.35 KiB

Previous results on branch: fix/set-measurement-crash

Startup times

Revision Plain With Sentry Diff
9bc0dc1 1221.45 ms 1238.69 ms 17.24 ms
097f0f6 1211.33 ms 1238.49 ms 27.16 ms

App size

Revision Plain With Sentry Diff
9bc0dc1 22.30 KiB 844.67 KiB 822.37 KiB
097f0f6 22.30 KiB 846.07 KiB 823.77 KiB

philipphofmann and others added 14 commits April 9, 2025 16:57
Calling setMeasurement on transactions ans spans could lead to crashes.
This is fixed now by making it thread safe.
#5061)

Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1.12.0 to 2.0.2.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](actions/create-github-app-token@d72941d...3ff1caa)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-version: 2.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [fastlane](https://github.com/fastlane/fastlane) from 2.227.0 to 2.227.1.
- [Release notes](https://github.com/fastlane/fastlane/releases)
- [Changelog](https://github.com/fastlane/fastlane/blob/master/CHANGELOG.latest.md)
- [Commits](fastlane/fastlane@fastlane/2.227.0...fastlane/2.227.1)

---
updated-dependencies:
- dependency-name: fastlane
  dependency-version: 2.227.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
fix duplicate note in continuous profiling GA entry
@philipphofmann
Copy link
Member Author

Sorry about the commit messup, I accidentially merged #5067 into this one before merging this PR.

@philipphofmann philipphofmann merged commit 62584b3 into main Apr 10, 2025
74 of 75 checks passed
@philipphofmann philipphofmann deleted the fix/set-measurement-crash branch April 10, 2025 08:55
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.

5 participants