Skip to content

feat: app scenes support#187

Open
mario-launchdarkly wants to merge 8 commits into
mainfrom
feature/oll1-729
Open

feat: app scenes support#187
mario-launchdarkly wants to merge 8 commits into
mainfrom
feature/oll1-729

Conversation

@mario-launchdarkly
Copy link
Copy Markdown
Contributor

@mario-launchdarkly mario-launchdarkly commented Apr 13, 2026

Note

Medium Risk
Changes how AppStart traces are classified and timed in multi-scene apps, which affects observability metrics; sample-app credential wiring changed but hardcoded keys were removed from schemes.

Overview
Adds UIScene-aware app start instrumentation: launch timing now pairs sceneWillEnterForeground with sceneDidBecomeActive, classifies cold, warm, and new sceneCreation launches per scene ID, and emits AppStart spans with start.type including sceneCreation. Cold starts measure from process start; additional scenes after the first cold launch are sceneCreation rather than warm.

Introduces shared SceneLaunchClassifier (also used by the MultiScene demo’s launch overlay) and refactors LaunchTracker to delegate classification and subscribe to scene notifications in that order. Span timestamps are derived from system uptime → Date, and LaunchMeter’s launch type enum gains sceneCreation for consistency.

Sample apps (ExampleApp, MultiwindowPad, TestApp) drop Env.swift and Xcode scheme env vars (including embedded mobile keys); config now comes from TestAppShared/Secrets.xcconfig via Info.plist (mobileKey, otlpEndpoint, backendUrl). MultiScene app wires observability startup and a visual launch-stats demo aligned with the new classifier.

Reviewed by Cursor Bugbot for commit 82b8f8e. Bugbot is set up for automated code reviews on this repo. Configure here.

@mario-launchdarkly mario-launchdarkly changed the title feat: app scenes support - unit tests feat: app scenes support Apr 14, 2026
Comment thread Sources/LaunchDarklyObservability/AutoInstrumentation/Launch/LaunchTracker.swift Outdated
Comment thread Sources/LaunchDarklyObservability/AutoInstrumentation/Launch/LaunchTracker.swift Outdated
Copy link
Copy Markdown
Contributor

@abelonogov-ld abelonogov-ld left a comment

Choose a reason for hiding this comment

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

Please attach SR and Trace/Logs screenshots, I fetched branch and I couldn't get them work.

Comment thread Sources/LaunchDarklyObservability/AutoInstrumentation/Launch/LaunchTracker.swift Outdated
Comment thread MultiSceneExampleApp/MultiwindowPad/AppDelegate.swift
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a566891. Configure here.

switch self {
case .cold: return "cold"
case .warm: return "warm"
case .sceneCreation: return "sceneCreation"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Duplicated enum and dead sceneCreation case in LaunchType

Low Severity

LaunchType and SceneLaunchClassification are duplicated enums with identical cases (cold, warm, sceneCreation) and identical description implementations. This PR adds .sceneCreation to LaunchType, but LaunchMeter (the only consumer of LaunchType) never produces that case — it only ever sets .cold or .warm — making it dead code. LaunchTracker was switched to use SceneLaunchClassification instead, so the extension of LaunchType serves no purpose.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a566891. Configure here.

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