getsentry / getsentry/sentry-react-native
Report JS Loop stalls as Errors (similar to App Hangs on iOS)
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.8k
- Forks
- 367
- Merge medio
- 1 d 6 h
- PR fusionados (30 d)
- 94
Descripción
**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?
Guía de contribución
Línea de trabajo
Comienza reproduciendo el bucle infinito de JavaScript del issue en una aplicación base de @sentry/react-native en iOS; después, inspecciona el punto de entrada del seguimiento de bloqueos de la aplicación del SDK y compara su comportamiento con el Cocoa SDK. Determina qué condiciones deberían emitir un evento y verifica que el bucle indicado cumple esas condiciones.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- ios, javascript, react-native, typescript
- Área
- mobile, observability
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100