Open
Conversation
Add `low_power_mode` boolean to the device context so it's available on all event types including crashes and watchdog terminations. The value is kept in sync via the NSProcessInfoPowerStateDidChange notification on the scope, and also read at capture time in SentryExtraContextProvider.
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Internal Changes 🔧Deps
🤖 This preview updates automatically when you update the PR. |
Contributor
|
Sentry Build Distribution
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7777 +/- ##
=============================================
+ Coverage 85.401% 85.410% +0.008%
=============================================
Files 487 487
Lines 29086 29117 +31
Branches 12602 12604 +2
=============================================
+ Hits 24840 24869 +29
Misses 4196 4196
- Partials 50 52 +2
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| bc00c87 | 1214.34 ms | 1245.67 ms | 31.33 ms |
| b590539 | 1220.42 ms | 1239.82 ms | 19.40 ms |
| 3950d78 | 1212.52 ms | 1243.20 ms | 30.68 ms |
| a47ad66 | 1221.94 ms | 1249.59 ms | 27.66 ms |
| 1a887e2 | 1212.46 ms | 1241.33 ms | 28.87 ms |
| eaeb9bc | 1216.22 ms | 1250.78 ms | 34.56 ms |
| 554a67d | 1225.85 ms | 1254.71 ms | 28.86 ms |
| 6515f11 | 1214.72 ms | 1244.82 ms | 30.10 ms |
| d68691e | 1221.48 ms | 1248.13 ms | 26.65 ms |
| 21cd5ba | 1218.68 ms | 1255.54 ms | 36.86 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| bc00c87 | 24.14 KiB | 1.13 MiB | 1.10 MiB |
| b590539 | 24.14 KiB | 1.12 MiB | 1.09 MiB |
| 3950d78 | 24.14 KiB | 1.11 MiB | 1.09 MiB |
| a47ad66 | 24.14 KiB | 1.13 MiB | 1.10 MiB |
| 1a887e2 | 24.14 KiB | 1.09 MiB | 1.07 MiB |
| eaeb9bc | 24.14 KiB | 1.12 MiB | 1.10 MiB |
| 554a67d | 24.14 KiB | 1.13 MiB | 1.10 MiB |
| 6515f11 | 24.14 KiB | 1.11 MiB | 1.09 MiB |
| d68691e | 24.14 KiB | 1.12 MiB | 1.09 MiB |
| 21cd5ba | 24.14 KiB | 1.04 MiB | 1.02 MiB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
low_power_modeboolean to the device context, available on all event typesNSProcessInfoPowerStateDidChangeNotificationinSentryCrashIntegrationto keep the scope's device context in sync, ensuring the value is persisted for crashes and watchdog terminationsSentryExtraContextProviderfor non-crash events@available(macOS 12.0, *)since the macOS deployment target is 10.14; available unconditionally on iOS, tvOS, watchOS, and visionOSTest plan
testLowPowerModeandtestLowPowerModeDisabledtests forSentryExtraContextProviderSentryExtraContextProviderTestspassSentryCrashIntegrationTestspass (31 tests)Fixes: #5322