feat: Expose crashed last run API
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- android, ios, react-native, typescript
Research direction
Start by locating the React Native native modules and the initialization path used after Sentry.init(), then compare the iOS lastRunStatus and Android isCrashedLastRun integrations described in the issue. Done means a callable JavaScript API exposes a documented, consistent result on both platforms.
Written by the indexing model from the issue text.
Description
Problem Statement
Both native SDKs now provide APIs to check if the previous app session ended in a crash:
- iOS (Cocoa SDK 9.8.0+):
SentrySDK.lastRunStatus— returns unknown, no-crash, or crash - Android:
Sentry.isCrashedLastRun()— returns a boolean
There is currently no way to access this information from the React Native (JavaScript) layer.
Use Cases
- Show a recovery UI (e.g., "Sorry, the app crashed") after restarting from a crash
- Disable experimental features that may have caused a crash
- Send custom analytics or breadcrumbs about crash recovery
- Implement progressive rollout logic that backs off after crashes
Proposed Solution
Expose a unified JS API, e.g.:
import * as Sentry from '@sentry/react-native';
const status = Sentry.lastRunStatus();
// Returns: 'unknown' | 'no-crash' | 'crash'
Implementation Notes
- Bridge
SentrySDK.lastRunStatuson iOS andSentry.isCrashedLastRun()on Android through the native modules - Normalize the return value across platforms (iOS has 3 states, Android has a boolean — need to decide on a unified shape)
- Should be callable after
Sentry.init()
References
- Cocoa SDK PR: https://github.com/getsentry/sentry-cocoa/issues/7469
- Cocoa SDK bump to 9.8.0: https://github.com/getsentry/sentry-react-native/pull/5847
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 369
- Avg merge
- 20h 53m
- Merged PRs (30d)
- 103
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from getsentry/sentry-react-native
-
Bug React-Native
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
getsentry/sentry-react-native#6821 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
React-Native Replays Task
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
getsentry/sentry-react-native#6680 · 1 comment ·
Maintainers usually reply within 1 day
-
Improvement React-Native
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getsentry/sentry-react-native#6143 · 2 comments ·
Maintainers usually reply within 1 day
-
React-Native Task User Feedbacks
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
getsentry/sentry-react-native#5932 · 2 comments ·
Maintainers usually reply within 1 day
-
React-Native Replays Task
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
getsentry/sentry-react-native#5882 · 1 comment ·
Maintainers usually reply within 1 day
All issues in getsentry/sentry-react-native
Similar issues
-
check:failed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
iptv-org/iptv#53974 · 1 comment ·
Maintainers usually reply within 1 day
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
interledger/rafiki#3986 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Doist/todoist-cli#576 ·
Maintainers usually reply within 1 day
-
feature
Difficulty 1/5 Under an hour Newbie friendliness 72/100
vercel-labs/skills#2370 ·
Maintainers usually reply within 1 day
-
🐛 Bug supabase/cli
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day