Skip to content

fix: pause app hang detection when going on the background - #1506

Open
bitsandfoxes wants to merge 3 commits into
mainfrom
fix/pause-app-hang
Open

fix: pause app hang detection when going on the background#1506
bitsandfoxes wants to merge 3 commits into
mainfrom
fix/pause-app-hang

Conversation

@bitsandfoxes

Copy link
Copy Markdown
Contributor

Relies on getsentry/sentry-native#1928

To prevent false positives like reporting an app hang event because the game went on the background.

@bitsandfoxes
bitsandfoxes marked this pull request as draft July 30, 2026 09:16
@bitsandfoxes
bitsandfoxes marked this pull request as ready for review July 31, 2026 09:15

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1e1ac54. Configure here.

OnWillEnterBackgroundDelegateHandle = FCoreDelegates::ApplicationWillEnterBackgroundDelegate.AddLambda([this]()
{
bAppIsForeground.AtomicSet(false);
PauseAppHangTracking();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android pause silently never applies

High Severity

On Android, backgrounding stops heartbeats via bAppIsActive/bAppIsForeground while PauseAppHangTracking only runs if dlsym finds sentry_app_hang_pause. The bundled Java SDK NDK is still native 0.16.0, so that symbol is missing, pause is a silent no-op, and the watchdog stays armed without heartbeats—so false app-hang events can still fire (or start firing if frames continue in the background).

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1e1ac54. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair. We would need to wait for a sentry-java release. Or bump it's dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant