sentry-unity icon indicating copy to clipboard operation
sentry-unity copied to clipboard

Events not captured from Unity WebGL build after scene change

Open MobikTech opened this issue 1 year ago • 2 comments
trafficstars

Environment

How do you use Sentry? Sentry SaaS (sentry.io)

Which version of the SDK? 2.0.6

How did you install the package? (Git-URL, Assetstore) Git-URL

Which version of Unity? 2021.3.32f1

Is this happening in Unity (editor) or on a player like Android, iOS, Windows? It is happening on WebGL build(dont know if on another platforms also, did not tested). In Editor bug is NOT reproduced

Steps to Reproduce

  1. Integrate Sentry SDK events/messages/errors/unhandledExceptions capturing on first and second scenes via SentrySdk.Capture[] methods.
  2. Capturing executed from UniTask loop in custom non MonoBehaviour classes.
  3. Make game build on WebGL platform(dev/usual, doesn't matter)
  4. Run build on any browser(tested on Chrome and Firefox, both reproduced bug).

Expected Result

All calls of SentrySdk.Capture[] methods and unhandled exceptions will be gathered and displayed on sentry.io.

Actual Result

While first scene is loaded and active all events sending to cloud correctly. But after a moment of second scene loaded all events stops to send. After this, each sending try throws NullReference exception to browser console from internal SentrySDK code(see the screenshots). image

Exceptions thrown from internal DoSendEvent method and catched by try/catch block. image

Any logs or screenshots

SentryConfiguration on which build was tested: image image image image image image image

Detailed log of Error message: image

MobikTech avatar Jun 04 '24 08:06 MobikTech