Skip to content

Isolate Install() collector failures in Audience SDK#818

Closed
nattb8 wants to merge 1 commit into
mainfrom
feat/audience-launch-context-crash
Closed

Isolate Install() collector failures in Audience SDK#818
nattb8 wants to merge 1 commit into
mainfrom
feat/audience-launch-context-crash

Conversation

@nattb8

@nattb8 nattb8 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

What

CollectGameLaunchProperties() and CollectContext() ran back to back with no error handling in AudienceUnityHooks.Install(). An exception in either (most likely a Screen.currentResolution read too early in boot) aborted Install() before the other collector's provider was assigned, silently disabling it too. Each collector now runs in its own try/catch, with the failure logged via Log.Warn and its provider still assigned using whatever partial data survives.

Why

Field data showed real integrators hitting exactly this: one early-boot exception silently stripped context (locale/screen/timezone/userAgent) and game_launch device fields from every event for practically the whole session, with no crash or visible error to flag it.

Test plan

  • Reproduced the original bug in the Unity Editor: forced CollectContext() to throw, confirmed the uncaught exception silently blanked context and game_launch properties for the rest of the session (verified via raw event payloads)
  • Applied the fix and re-tested with only the screen read forced to throw: confirmed a logged warning instead of an uncaught exception, and that locale/timezone/userAgent still came through with only screen missing
  • Confirmed game_launch's own properties (version, cpu, gpu, unity_version, etc.) were unaffected by the context-collector failure, verifying the two collectors are isolated from each other
  • Run the existing Audience unit test suite (blocked locally by a pre-existing, unrelated missing-assembly issue in the generated csproj outside Unity; needs Unity Editor Test Runner or CI)

…sable the other

CollectGameLaunchProperties() and CollectContext() ran unguarded back to back in Install(), so an exception in either (e.g. a Screen.currentResolution read too early in boot) left both providers unassigned for the rest of the session, silently stripping context and game_launch device data from every event. Each collector is now isolated in its own try/catch, with the failure logged and the provider still assigned (with whatever partial data survives).
@nattb8 nattb8 requested review from a team as code owners July 10, 2026 02:11
@nattb8 nattb8 closed this Jul 10, 2026
@nattb8 nattb8 deleted the feat/audience-launch-context-crash branch July 10, 2026 02:12
@github-actions

Copy link
Copy Markdown

Audience SDK — Build Size

Platform SDK Size Change
Android 0.37 / 20.00 MB +0.00 MB
Windows 0.16 / 20.00 MB +0.00 MB
iOS 8.54 / 20.00 MB +0.03 MB
macOS 0.92 / 20.00 MB +0.02 MB

SDK Size = build minus empty app. Change = vs baseline. Fails if any platform exceeds its absolute size limit.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant