getsentry / getsentry/sentry-react-native

Report JS Loop stalls as Errors (similar to App Hangs on iOS)

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

説明

**Platform:**

- [X] iOS
- [ ] Android

**SDK:**

- [X] `@sentry/react-native` (>= 1.0.0)
- [ ] `react-native-sentry` (<= 0.43.2)

**SDK version:**
5.15.1

`react-native` version:
0.72.7

**Are you using Expo?**

- [ ] Yes
- [X] No

**Are you using [sentry.io]() or on-premise?**

- [X] [sentry.io]() (SaaS)
- [ ] on-premise
**Configuration:**

(`@sentry/react-native`)

```
Sentry.init({
dsn: 'MY_DSN',
debug:true
})
```

---

**I have the following issue:**

A user reported the app hanging but not event was sent to Sentry. As per docs:

> There are many reasons why an app may become unresponsive, such as long-running code, infinite loop bugs, and so on. With app hang tracking you can detect and fix them.

I created an infinite loop to test it and no app hang events were sent. The same infinite loop works fine with Cocoa SDK.

**Steps to reproduce:**

* Create a base react-native app
* Add Sentry to it
* Add the following button anywhere:

```
{
var i = 1;
while (i > 0){i++;}
}}
title="LeLoop"
color="#841584"
/>
```

* run the app on ios

It is still possible to scroll through the app, but all other buttons no longer work as the app is still on the loop. But no event is sent.

Under which conditions is it expected for an event to be sent?

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

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

調査の方向性

まず、iOS 上のベースとなる @sentry/react-native アプリで issue にある無限 JavaScript ループを再現し、次に SDK の app-hang トラッキングのエントリーポイントを調べ、その動作を Cocoa SDK と比較します。どの条件でイベントを発行すべきかを判断し、報告されたループがその条件に従っていることを確認します。

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

評価

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

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

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