getsentry / getsentry/sentry-react-native

Add Sentry.crashedLastRunEventId()

オープン
#2,789 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
Blocked Feature React-Native User Feedbacks
主要言語
TypeScript
スター
1.8k
フォーク
366
平均マージ
1日 6時間
マージ済み PR(30日)
94

説明

**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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

@sentry/react-native の Sentry.lastEventId() API と nativeCrash() の再現パスから始めます。payload にはソースファイルもテストも指定されていません。クラッシュを再現し、iOS アプリを再起動して、その境界をまたいでイベント ID がどのように扱われるかを確認します。再起動後に Sentry.crashedLastRunEventId() からクラッシュイベント ID を取得できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
ios, react-native, typescript
領域
mobile, observability-sre
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。