Skip to content

Hook up SDK to abandon app startup trace on background#1985

Merged
bidetofevil merged 1 commit intomainfrom
hho/abandon-startup-onbackground
Mar 6, 2025
Merged

Hook up SDK to abandon app startup trace on background#1985
bidetofevil merged 1 commit intomainfrom
hho/abandon-startup-onbackground

Conversation

@bidetofevil
Copy link
Contributor

@bidetofevil bidetofevil commented Mar 4, 2025

Goal

Register AppStartupTraceEmitter as service so the onBackground() callback will be invoked when the app background while while app startup is still taking place

As a result, we had to make sure the integration tests that aren't faking app startup (which means the startup data it collects will be incomplete) ignore internal errors that are generated for when app startup trace cannot be generated.

Similarly, startup traces will now be generated if the conditions are corrected, so those tests that assume that only the logs they create will be exported need to be modified to ignore the internal errors (which are also OTel logs).

@codecov
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.41%. Comparing base (24ea319) to head (e27e7ec).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1985      +/-   ##
==========================================
+ Coverage   85.33%   85.41%   +0.07%     
==========================================
  Files         482      482              
  Lines       11233    11234       +1     
  Branches     1686     1686              
==========================================
+ Hits         9586     9595       +9     
+ Misses        906      901       -5     
+ Partials      741      738       -3     
Files with missing lines Coverage Δ
...cesdk/internal/injection/ModuleInitBootstrapper.kt 90.25% <100.00%> (+0.03%) ⬆️

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bidetofevil bidetofevil force-pushed the hho/abandon-startup-onbackground branch from 54feac0 to 4498a57 Compare March 5, 2025 01:06
@bidetofevil bidetofevil marked this pull request as ready for review March 5, 2025 01:06
@bidetofevil bidetofevil requested a review from a team as a code owner March 5, 2025 01:06
@bidetofevil bidetofevil requested review from fractalwrench and removed request for a team March 5, 2025 01:06
@bidetofevil bidetofevil force-pushed the hho/abandon-startup-onbackground branch from 4498a57 to 2e9a92c Compare March 5, 2025 01:22
Copy link
Member

@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.

LGTM pending CI

}
}

fun createForIntegrationTest(throwOnInternalError: Boolean = true): FakeEmbLogger = FakeEmbLogger(
Copy link
Member

Choose a reason for hiding this comment

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

Consider naming this something like fakeLogger() or fakeLoggerForIntegrationTest() - the current name doesn't describe what it does IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. I don't actually like how many times this has been invoked, so I may tweak that as well so the overriding cases don't have to create its own logger

@bidetofevil bidetofevil changed the base branch from hho/process-state-invocation to graphite-base/1985 March 5, 2025 16:02
@bidetofevil bidetofevil force-pushed the hho/abandon-startup-onbackground branch from 2e9a92c to 7dd0046 Compare March 5, 2025 16:10
@bidetofevil bidetofevil force-pushed the hho/abandon-startup-onbackground branch from 7dd0046 to 82628af Compare March 5, 2025 16:38
@bidetofevil bidetofevil changed the base branch from graphite-base/1985 to main March 5, 2025 16:39
@bidetofevil bidetofevil force-pushed the hho/abandon-startup-onbackground branch from 82628af to 95372a0 Compare March 5, 2025 16:39
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

Copy link
Contributor Author

bidetofevil commented Mar 6, 2025

Merge activity

  • Mar 6, 11:49 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Mar 6, 11:50 AM EST: Graphite rebased this pull request as part of a merge.
  • Mar 6, 12:06 PM EST: A user merged this pull request with Graphite.

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