getsentry / getsentry/sentry-react-native

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

Aperta
#3,460 5 commenti 1 reazione 0 assegnatari Vedi su GitHub
Errors Feature React-Native
Lingua principale
TypeScript
Stelle
1.8k
Fork
366
Merge medio
1g 6h
PR unite (30g)
94

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo il loop JavaScript infinito dell'issue in un'app @sentry/react-native di base su iOS, quindi esamina il punto di ingresso del tracciamento degli app hang dell'SDK e confronta il suo comportamento con quello del Cocoa SDK. Determina quali condizioni dovrebbero generare un evento e verifica che il loop segnalato soddisfi tali condizioni.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
ios, javascript, react-native, typescript
Ambito
mobile, observability
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.