Skip to content

feat: hang detection (ANR) — Android support#16

Draft
bobbyg603 wants to merge 1 commit into
mainfrom
feat/hang-detection
Draft

feat: hang detection (ANR) — Android support#16
bobbyg603 wants to merge 1 commit into
mainfrom
feat/hang-detection

Conversation

@bobbyg603
Copy link
Copy Markdown
Member

Summary

  • Bumps com.bugsplat:bugsplat-android 1.2.0 → 1.3.0, which automatically detects and reports historical ANRs via ApplicationExitInfo on Android 11+ each time init() is called (no additional config needed).
  • Adds a cross-platform hang() test helper that blocks the native main thread on Android for end-to-end ANR verification. iOS / Expo Go / web log a warning.
  • Wires a "Trigger Hang" button into the example app (release-build, Android-only).
  • Verified end-to-end on a Pixel 7 API 35 emulator release build — ANR fired, was captured via ApplicationExitInfo, and uploaded by AnrReporter on the next init().

Closes #15.

Draft — awaiting iOS implementation

This PR is kept in draft while iOS hang detection lands upstream in bugsplat-apple. The iOS Swift module currently no-ops hang() with an NSLog, matching the "not yet supported" contract in the TypeScript layer. Once the iOS SDK exposes a hang helper, a follow-up commit on this branch will wire it through and we can mark the PR ready for review.

Test plan

  • npm test — 76/76 pass (added hang coverage to native, Expo Go, and web suites)
  • npx tsc --noEmit clean
  • Release build on Android 15 emulator (google_apis image): tap Init → tap Trigger Hang → system ANR dialog fires → relaunch → ANR report uploaded to BugSplat as crash_type = Android.ANR
  • iOS hang verification — pending upstream SDK support

🤖 Generated with Claude Code

Upgrades bugsplat-android from 1.2.0 to 1.3.0, which automatically
captures historical ANRs via ApplicationExitInfo on Android 11+ at
init() time. Exposes a cross-platform hang() test helper that blocks
the native main thread on Android and warns on iOS/Expo Go/web.

iOS hang detection is pending upstream bugsplat-apple support.

Closes #15

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Support Hang Detection (ANR)

1 participant