Skip to content

fix(android): report low-memory kills as app_exit, skip the exit-info backlog on first launch - #8

Draft
nitinstp23 wants to merge 1 commit into
feat/app-startup-duration-msfrom
fix/exit-info-low-memory
Draft

nitinstp23 wants to merge 1 commit into
feat/app-startup-duration-msfrom
fix/exit-info-low-memory

Conversation

@nitinstp23

Copy link
Copy Markdown
Contributor

Jira: B14-2074 (epic B14-4). Stacked on #7. Parity with scout-flutter #8.

Why

ScoutExitInfoClassifier treated ApplicationExitInfo REASON_LOW_MEMORY (the OS reclaiming a cached background process) as crash-class, so React Native tenants report background kills as native_crash. Play Console and Crashlytics never count these; on snabbit's Flutter apps they were 100% of all native_crash spans. The collector also drained the whole OS exit history (up to 50 records) on the first launch with no watermark, into the session that had just started.

What changes

  • ScoutExitInfoClassifier.crashTypeFor("low_memory")null; new exitReasonFor() returns low_memory for the app_exit path; SPAN_KEY = "scout.span" / APP_EXIT marker on the pending report.
  • ScoutExitInfoCollector.drain: lastTs == 0 (no watermark) records the newest timestamp and returns without writing reports.
  • native-crash.ts: reports carrying scout.span: app_exit are emitted as SPAN.APP_EXIT with crash.*exit.* (exit.reason, exit.description, exit.importance, …) via the exported toAppExitAttributes().
  • SPAN.APP_EXIT added; ERROR_CLASS_SPANS and the view crash counter are untouched, so app_exit never counts as a crash and does not bypass sampling.
  • Tests: ExitInfoFilterTest.kt (three crash-class reasons, low_memory benign, exitReasonFor table), native-crash.test.ts (rename shape + marker contract).
  • CHANGELOG 0.1.19, docs/configuration.md, README; version 0.1.18 → 0.1.19.

Verification

  • vitest: 33 files, 296 tests passing. tsc --noEmit clean for both tsconfigs.
  • Kotlin unit tests: see the PR checks / run android/unit-tests/gradlew test.
  • Not yet done: on-device Android 11+ check (LMK kill → one app_exit, no native_crash; fresh install → no backlog).

Rollout note

Crash counts will drop for apps on 0.1.19; re-baseline alerts on native_crash.

… backlog on first launch

B14-2074, parity with scout-flutter 0.3.0. ApplicationExitInfo
REASON_LOW_MEMORY (the OS reclaiming a cached background process) was
written as a native_crash report; Play Console and Crashlytics don't
count it and on aggressive OEMs it outnumbers real crashes. The
classifier no longer treats it as crash-class; the collector writes it
with a scout.span=app_exit marker and the JS reader emits an app_exit
span with crash.* renamed to exit.* (exit.reason, exit.description).
A first launch with no drain watermark now records one and reports
nothing instead of draining up to 50 historical deaths into the
session that just started. Version 0.1.18 -> 0.1.19.
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.

1 participant