getsentry / getsentry/sentry-react-native
Add Sentry.crashedLastRunEventId()
- Langage dominant
- TypeScript
- Étoiles
- 1.8k
- Forks
- 367
- Merge moyen
- 1 j 6 h
- PR mergées (30 j)
- 94
Description
**OS:**
- [ ] Windows
- [X] MacOS
- [ ] Linux
**Platform:**
- [X] iOS
- [ ] Android
**SDK:**
- [X] `@sentry/react-native` (>= 1.0.0)
- [ ] `react-native-sentry` (<= 0.43.2)
**SDK version:** 4.12.0
`react-native` version: 0.69.3
**Are you using Expo?**
- [ ] Yes
- [X] No
**Are you using **[**sentry.io**]()** or on-premise?**
- [X] [sentry.io]() (SaaS)
- [ ] on-premise
**If you are using **[**sentry.io**]()**, please post a link to your issue so we can take a look:**
N/A
**Configuration:**
(`import * as Sentry from "@sentry/react-native";`)
```
Sentry.init({
sampleRate: sampleRate?.errorSampleRate
? sampleRate?.errorSampleRate
: 0.5, //We fetch the sample rate on app launch/initialization we have a 50% sample rate as a fallback in the event we fail to fetch or device is offline
enableNativeCrashHandling: true,
// allows redux object to serialise deeply
normalizeDepth: 5,
dsn: 'https://...@sentry.io/...'
environment: jsEnv.SENTRY_ENVIRONMENT,
integrations: [
rewriteFramesIntegration,
new ExtraErrorData({ depth: 4 }),
new Sentry.ReactNativeTracing({
routingInstrumentation
})
],
...sentryOptions
});
```
---
**I have following issue:**
Tried calling `Sentry.lastEventId()` on the main screen of our app after a crash had happened and it returned `undefined`.
Looks like event Id is not persisted?
**Steps to reproduce:**
* Call `nativeCrash()` from "@sentry/react-native"
* On app relaunch call `Sentry.lastEventId()` and inspect value returned.
**Actual result:**
`undefined`
**Expected result:**
Some sort of Id
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par l’API Sentry.lastEventId() et le chemin de reproduction de nativeCrash() dans @sentry/react-native ; le payload n’indique ni fichier source ni test. Reproduisez le crash, relancez l’application iOS et examinez la manière dont l’ID de l’événement est géré au franchissement de cette limite. C’est terminé lorsqu’un ID d’événement de crash est disponible via Sentry.crashedLastRunEventId() après la relance.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- ios, react-native, typescript
- Domaine
- mobile, observability-sre
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 42/100