Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add context to event with CrashHandler disabled #3699

Merged
merged 21 commits into from
Mar 7, 2024

Conversation

brustolin
Copy link
Contributor

📜 Description

If crashHandler is disabled the SDK does not add device and app context to events.

⚠️ First review this PR

💡 Motivation and Context

close #3694

💚 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

@brustolin brustolin linked an issue Mar 1, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Mar 1, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1199.76 ms 1217.60 ms 17.84 ms
Size 21.58 KiB 540.15 KiB 518.57 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
56ec5d0 1194.39 ms 1236.94 ms 42.55 ms
d1d5c2d 1239.20 ms 1251.92 ms 12.72 ms
e758449 1243.41 ms 1246.71 ms 3.31 ms
8f397a7 1196.55 ms 1226.82 ms 30.27 ms
277f226 1241.65 ms 1253.74 ms 12.09 ms
7cd187e 1239.39 ms 1258.02 ms 18.63 ms
8d16504 1235.50 ms 1258.76 ms 23.26 ms
3f1be0f 1208.12 ms 1225.72 ms 17.60 ms
c78683b 1255.78 ms 1261.94 ms 6.16 ms
3f366ee 1242.28 ms 1260.80 ms 18.52 ms

App size

Revision Plain With Sentry Diff
56ec5d0 20.76 KiB 414.44 KiB 393.68 KiB
d1d5c2d 20.76 KiB 427.83 KiB 407.07 KiB
e758449 22.85 KiB 407.62 KiB 384.77 KiB
8f397a7 20.76 KiB 420.55 KiB 399.79 KiB
277f226 22.84 KiB 401.67 KiB 378.83 KiB
7cd187e 20.76 KiB 401.65 KiB 380.89 KiB
8d16504 20.76 KiB 434.92 KiB 414.16 KiB
3f1be0f 20.76 KiB 414.44 KiB 393.69 KiB
c78683b 20.76 KiB 435.24 KiB 414.47 KiB
3f366ee 20.76 KiB 427.84 KiB 407.08 KiB

Previous results on branch: fix/event-context-without-crashhandler

Startup times

Revision Plain With Sentry Diff
d4b5b40 1228.92 ms 1249.85 ms 20.94 ms
c52bc75 1224.96 ms 1248.89 ms 23.94 ms
5925cd1 1192.17 ms 1211.68 ms 19.51 ms

App size

Revision Plain With Sentry Diff
d4b5b40 21.58 KiB 424.41 KiB 402.83 KiB
c52bc75 21.58 KiB 540.15 KiB 518.57 KiB
5925cd1 21.58 KiB 424.41 KiB 402.82 KiB

@brustolin brustolin marked this pull request as draft March 1, 2024 15:26
@brustolin brustolin marked this pull request as ready for review March 4, 2024 10:02
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

The SentryCrashIntegrationTests contains the tests for enriching the scope context. I think it would be great to move these tests to a different location.

CHANGELOG.md Outdated Show resolved Hide resolved
Sources/Sentry/SentryHub.m Outdated Show resolved Hide resolved
Sources/Sentry/SentrySDK.m Outdated Show resolved Hide resolved
Tests/SentryTests/SentryHubTests.swift Show resolved Hide resolved
Base automatically changed from ref/dependencycontainer-without-hub to main March 5, 2024 12:53
Sources/Sentry/SentrySDK.m Outdated Show resolved Hide resolved
Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 92.68293% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 89.348%. Comparing base (0204c72) to head (434d83e).

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #3699       +/-   ##
=============================================
+ Coverage   89.316%   89.348%   +0.032%     
=============================================
  Files          533       534        +1     
  Lines        58885     59036      +151     
  Branches     21120     21205       +85     
=============================================
+ Hits         52594     52748      +154     
- Misses        5249      5253        +4     
+ Partials      1042      1035        -7     
Files Coverage Δ
Sources/Sentry/SentryCrashIntegration.m 97.938% <ø> (+3.236%) ⬆️
Sources/Sentry/SentryCrashWrapper.m 89.814% <100.000%> (+12.263%) ⬆️
Sources/Sentry/SentryHub.m 98.520% <100.000%> (+0.006%) ⬆️
...entryCrash/Recording/Monitors/SentryCrashMonitor.c 43.000% <ø> (ø)
...yCrash/Recording/Monitors/SentryCrashMonitorType.h 50.000% <100.000%> (ø)
...ions/SentryCrash/SentryCrashIntegrationTests.swift 84.259% <ø> (-0.426%) ⬇️
Tests/SentryTests/SentryHubTests.swift 98.427% <100.000%> (+0.011%) ⬆️
Tests/SentryTests/SentryInterfacesTests.m 100.000% <100.000%> (ø)
...rding/Monitors/SentryCrashMonitor_CPPException.cpp 30.909% <0.000%> (+0.278%) ⬆️
...ash/Recording/Monitors/SentryCrashMonitor_System.m 68.674% <84.313%> (-1.114%) ⬇️

... and 24 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 0204c72...434d83e. Read the comment docs.

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LGTM, thanks 👍

@brustolin brustolin merged commit 788b82b into main Mar 7, 2024
70 checks passed
@brustolin brustolin deleted the fix/event-context-without-crashhandler branch March 7, 2024 15:33
threema-matteo pushed a commit to threema-ch/sentry-cocoa that referenced this pull request May 21, 2024
If crashHandler is disabled the SDK does not add device and app context to events
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.

Make enriched Scope independent of SentryCrashIntegration
3 participants