Part of #74. Optional, independent.
Spec: docs/sentry-integration-plan.md Phase 7b.
iOS only tells us "why was the app killed" as 24-hour aggregate counts (Apple's MetricKit reports), with no timestamps. This workblock adds a simple heuristic for per-incident detail: record the app's lifecycle state on disk as it changes, and on the next launch, if the previous run didn't end cleanly, report one "ios kill inferred" event saying whether the app was in the background and roughly how long it had been there.
Deliverables
Tests
AppKillHeuristicTests.swift with a fake store + clock: a clean shutdown suppresses the event; a stale marker fires once then clears; foreground vs background drives the tag correctly
- Manual check by forcing a low-memory kill
Part of #74. Optional, independent.
Spec:
docs/sentry-integration-plan.mdPhase 7b.iOS only tells us "why was the app killed" as 24-hour aggregate counts (Apple's MetricKit reports), with no timestamps. This workblock adds a simple heuristic for per-incident detail: record the app's lifecycle state on disk as it changes, and on the next launch, if the previous run didn't end cleanly, report one "ios kill inferred" event saying whether the app was in the background and roughly how long it had been there.
Deliverables
ios/AppKillHeuristic.swift: write background / foreground / terminated-cleanly plus a timestamp to on-device storage on each lifecycle change. On cold start, an unclean previous state produces one event taggedios.killed_in_background, withlast_known_stateandtime_since_last_state_msTests
AppKillHeuristicTests.swiftwith a fake store + clock: a clean shutdown suppresses the event; a stale marker fires once then clears; foreground vs background drives the tag correctly