Skip to content

fix(audience): isolate Install() collector failures#819

Merged
nattb8 merged 1 commit into
mainfrom
fix/audience-launch-context-crash
Jul 10, 2026
Merged

fix(audience): isolate Install() collector failures#819
nattb8 merged 1 commit into
mainfrom
fix/audience-launch-context-crash

Conversation

@nattb8

@nattb8 nattb8 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Fixes SDK-682

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)

@nattb8 nattb8 requested review from a team as code owners July 10, 2026 02:13
…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 force-pushed the fix/audience-launch-context-crash branch from f24aca2 to 80a073c Compare July 10, 2026 02:25
@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.

@nattb8 nattb8 changed the title Isolate Install() collector failures in Audience SDK fix(audience): isolate Install() collector failures in Audience SDK Jul 10, 2026
@nattb8 nattb8 changed the title fix(audience): isolate Install() collector failures in Audience SDK fix(audience): isolate Install() collector failures Jul 10, 2026
@nattb8 nattb8 merged commit e693d4a into main Jul 10, 2026
62 of 73 checks passed
@nattb8 nattb8 deleted the fix/audience-launch-context-crash branch July 10, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants