Skip to content

feat(audience): normalize platform wire values, add isEditor (SDK-343)#771

Merged
ImmutableJeffrey merged 1 commit into
mainfrom
feat/sdk-343-normalize-platform-wire-values
May 11, 2026
Merged

feat(audience): normalize platform wire values, add isEditor (SDK-343)#771
ImmutableJeffrey merged 1 commit into
mainfrom
feat/sdk-343-normalize-platform-wire-values

Conversation

@ImmutableJeffrey
Copy link
Copy Markdown
Collaborator

@ImmutableJeffrey ImmutableJeffrey commented May 11, 2026

Summary

Normalizes the platform wire value for the audience SDK's auto-emitted game_launch event so the public schema speaks layman OS names instead of Unity's RuntimePlatform enum strings, and adds an isEditor boolean so studios can filter dev runs cleanly.

  • DeviceCollector.PlatformName maps RuntimePlatform to Windows, macOS, Linux, iOS, Android. The Windows / OSX / Linux Player and Editor variants collapse to a single OS string each.
  • Console, WebGL, server, and other unmapped RuntimePlatform values fall through to platform.ToString(), so traffic from those targets is not silently dropped.
  • Adds an isEditor boolean to game_launch, sourced from Application.isEditor. Replaces the Player-vs-Editor distinction previously embedded in platform, so studios can filter dev runs out of production analytics on a dedicated field.
  • osFamily is intentionally left as the raw SystemInfo.operatingSystemFamily.ToString() value (Windows, MacOSX, Linux, Other). platform is the curated public field; osFamily stays as a passthrough so power users still have direct access to Unity's view.
  • CollectGameLaunchProperties gains an isEditorOverride parameter alongside the existing platformOverride, so the new mappings are deterministically testable.
  • DeviceCollectorTests covers the new platform mappings for Windows / macOS / Linux in both Player and Editor variants, iOS, Android, unmapped fallback, and isEditor true and false.
  • ImmutableAudienceTests.Init_GameLaunch_IncludesLaunchContextProviderFields example value updated from "WindowsPlayer" to "Windows" for consistency with the new convention.

Breaking wire-format change for platform. Any downstream consumer that filters on WindowsPlayer / OSXPlayer / LinuxPlayer will need updating. The public data dictionary in immutable/documentation is updated in parallel by #83.

Linear: SDK-343

@ImmutableJeffrey ImmutableJeffrey requested review from a team as code owners May 11, 2026 00:48
@ImmutableJeffrey ImmutableJeffrey force-pushed the feat/sdk-343-normalize-platform-wire-values branch from fffbebd to f2a65d5 Compare May 11, 2026 00:51
nattb8
nattb8 previously approved these changes May 11, 2026
@ImmutableJeffrey ImmutableJeffrey force-pushed the feat/sdk-343-normalize-platform-wire-values branch from f2a65d5 to 6a44f72 Compare May 11, 2026 01:31
@ImmutableJeffrey ImmutableJeffrey changed the title feat(audience): normalize platform/osFamily wire values, add isEditor (SDK-343) feat(audience): normalize platform wire values, add isEditor (SDK-343) May 11, 2026
Comment thread src/Packages/Audience/Runtime/Unity/DeviceCollector.cs
@ImmutableJeffrey ImmutableJeffrey force-pushed the feat/sdk-343-normalize-platform-wire-values branch from 6a44f72 to 0e12f39 Compare May 11, 2026 04:20
- platform now sends Windows, macOS, Linux, iOS, Android. WindowsPlayer/WindowsEditor
  and OSXPlayer/OSXEditor and LinuxPlayer/LinuxEditor each collapse to one OS string.
  Studios no longer need LIKE 'Windows%' to filter by OS.
- New isEditor bool on game_launch sources from Application.isEditor. Replaces the
  Player vs Editor signal previously buried inside platform, so studios can filter dev
  runs cleanly.
- Unmapped RuntimePlatform values (console, WebGL, server builds) still fall back to
  the raw enum string so console traffic is not silently dropped.
- osFamily is intentionally left as the raw SystemInfo.operatingSystemFamily value
  (Windows, MacOSX, Linux, Other), so power users still have direct access to Unity's
  view. platform is the curated public field; osFamily is the passthrough.
- DeviceCollectorTests covers the new platform mappings and isEditor true/false.
  ImmutableAudienceTests provider example updated to "Windows".

Breaking wire-format change. Blocks immutable/documentation#83 (SDK-319).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ImmutableJeffrey ImmutableJeffrey force-pushed the feat/sdk-343-normalize-platform-wire-values branch from 0e12f39 to bb11e12 Compare May 11, 2026 05:12
@ImmutableJeffrey ImmutableJeffrey enabled auto-merge (rebase) May 11, 2026 05:29
@ImmutableJeffrey ImmutableJeffrey merged commit 773eb68 into main May 11, 2026
61 of 67 checks passed
@ImmutableJeffrey ImmutableJeffrey deleted the feat/sdk-343-normalize-platform-wire-values branch May 11, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants