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(oom): Improve background app state detection #394

Merged
merged 4 commits into from
Jul 30, 2019

Conversation

kattrali
Copy link
Contributor

Goal

Correctly determine foreground/active state when the app is launched via a background fetch or media playback event or extension, or is interrupted by Siri or a phone call. These cases should be regarded as in the background or inactive respectively.

Changeset

  • Added detection for app extension state
  • Added initial app state (foreground and active) checking

Tests

  • Added additional end-to-end tests for when the app is interrupted and will terminate normally (for completeness)

@kattrali kattrali force-pushed the kattrali/fix-bg-oom-stats branch from 084d943 to c422ee1 Compare July 22, 2019 17:11
@codecov
Copy link

codecov bot commented Jul 22, 2019

Codecov Report

Merging #394 into master will decrease coverage by 0.23%.
The diff coverage is 46.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #394      +/-   ##
==========================================
- Coverage    52.6%   52.36%   -0.24%     
==========================================
  Files          65       65              
  Lines        7454     7497      +43     
==========================================
+ Hits         3921     3926       +5     
- Misses       3533     3571      +38
Impacted Files Coverage Δ
...SCrash/Source/KSCrash/Recording/BSG_KSSystemInfo.h 100% <ø> (ø) ⬆️
Source/BugsnagBreadcrumb.m 83.24% <0%> (ø) ⬆️
...SCrash/Source/KSCrash/Recording/BSG_KSSystemInfo.m 75.19% <100%> (+1.53%) ⬆️
Source/BugsnagNotifier.m 51.89% <37.03%> (-0.16%) ⬇️
Source/BSGOutOfMemoryWatchdog.m 28.47% <9.09%> (-1.9%) ⬇️
Source/BugsnagLogger.h 66.66% <0%> (-33.34%) ⬇️
Source/BugsnagSessionTrackingApiClient.m 78.72% <0%> (-8.52%) ⬇️
Source/BugsnagFileStore.m 62.85% <0%> (-6.67%) ⬇️

Continue to review full report at Codecov.

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

Copy link
Contributor

@fractalwrench fractalwrench left a comment

Choose a reason for hiding this comment

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

Left a few comments inline that'd be good to address/resolve, particularly the breaking change/mazerunner comments. Overall this seems like a good approach, although it'd be good to have a bit more background on how this could be tested for the purposes of code review.

CHANGELOG.md Show resolved Hide resolved
features/steps/ios_steps.rb Outdated Show resolved Hide resolved
Source/BugsnagBreadcrumb.h Outdated Show resolved Hide resolved
features/out_of_memory.feature Show resolved Hide resolved
features/out_of_memory.feature Outdated Show resolved Hide resolved
Source/BSGOutOfMemoryWatchdog.m Show resolved Hide resolved
Source/BSGOutOfMemoryWatchdog.m Outdated Show resolved Hide resolved
Source/BSGOutOfMemoryWatchdog.m Show resolved Hide resolved
Source/BSGOutOfMemoryWatchdog.m Show resolved Hide resolved
@kattrali kattrali force-pushed the kattrali/fix-bg-oom-stats branch 3 times, most recently from 9899e5f to de94c75 Compare July 30, 2019 16:58
@kattrali kattrali force-pushed the kattrali/fix-bg-oom-stats branch from de94c75 to 4502ac2 Compare July 30, 2019 18:16
@kattrali kattrali merged commit bcfc067 into master Jul 30, 2019
@kattrali kattrali deleted the kattrali/fix-bg-oom-stats branch July 30, 2019 19:21
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.

2 participants