getsentry / getsentry/sentry-react-native
Report JS Loop stalls as Errors (similar to App Hangs on iOS)
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 366
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 89
Description
**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?
Contributor guide
Assessment
This issue has not been assessed yet.