getsentry / team-mobile

Meta issues for the Mobile team
4 stars 1 forks source link

Forced app termination detection #68

Open philipphofmann opened 2 years ago

philipphofmann commented 2 years ago

When an app doesn't work, I tend to manually terminate it and immediately open it again to fix the problem. For some apps, I already know when this is happening. I do it before our ANR detection kicks in, and the app is also not crashing. Our SDKs would not detect such an issue at the moment.

Seeing forced app termination issues in Sentry would be great for me as a mobile developer.

I'm unsure what the best way to detect forced app terminations by the user is. We could detect such potential problems by comparing the time when the user manually terminated the app and reopened it again. We could report an issue if the duration is less than a specified threshold, such as 3 seconds. The issue would need the state when the user manually closed it. For that, we could need to store an event on disk every time the user terminates the app, similar to an ANR, but only send it the next time the app launches if the duration is less than the previously mentioned threshold.