#False positive app hangs on iOS with Godot

8 messages · Page 1 of 1 (latest)

frozen coral
#

Hi, loving Sentry so far. Unfortunately we're getting flooded with app hang errors when the app presents the ATT (tracking permission). The docs suggest using pauseAppHangTracking() to avoid this, but Sentry for Godot doesn't seem to have this feature. Is there another solution or any way to keep these from using up our quota?

frozen coral
#

False positive app hangs on iOS with Godot

frozen coral
#

Okay just saw that you can filter events before sending. Will close this once I'm sure it's working.

frozen coral
#

Hm that doesn't seem to work actually 😕 I think there may be a bug here? I turned off auto-init in settings and initialized Sentry at app start like this:

        options.before_send = Globals.on_before_send_to_sentry
    )```

and here's that before send method:
```func on_before_send_to_sentry(event: SentryEvent) -> SentryEvent:
    prints("sentry event before send:", event.message)
    # Process event and return either the same event object,
    # with or withour modifications, or null to skip reporting the event.
    if "App Hanging" in event.message and not report_app_hanging:
        prints("skipping app hang event")
        return null
    elif "Mouse is not supported" in event.message:
        # prevent irrelevant "Mouse is not supported by this display server." error on iOS
        return null
    return event```

then I tested this running in the Godot editor by triggering a divide-by-zero error. Breakpointing on the first print line, I saw that the event.message was empty (all other fields seem correct though). which means I cannot check the type of event. Furthermore, when I ran the game on iPhone through Xcode, nothing even got printed, even though I can see the issues that triggered coming through on the web. So seems like the before send callback isn't even happening on iOS.
frozen coral
raw crescent
#

HI @frozen coral Thanks for reaching out.
Normally, event.message is used in capture_message. The error message is stored in event.exception, which is not currently exposed. Recently, we've added API to access it, which should be out in the next version.

Actually, there are two PRs merged that are related to your issue. It will be released the coming week in 1.1.0 version.
One is increasing app hanging time to 5s, and the second one is accessing the error message in before_send:

frozen coral
raw crescent
#

Our tests rely on before_send, it should be working. There are some nuances with crash events. Like the event is actually sent on app restart on some platforms (Android and Apple).