Attach sessionId to every outbound Audience message#813
Draft
nattb8 wants to merge 1 commit into
Draft
Conversation
session_id was previously only attached to session_start/heartbeat/end via manual properties writes, leaving custom Track calls, Identify, Alias, and built-ins like game_launch with no session correlation. Session now passes its captured session id through the TrackDelegate so ImmutableAudience can stamp a sessionId field on every message envelope automatically, including for session_end where the id must come from the value captured before Session resets its live state.
951f64f to
9a0c1ef
Compare
Audience SDK — Build Size
SDK Size = build minus empty app. Change = vs baseline. Fails if any platform exceeds its absolute size limit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
session_idwas only attached to the three session-lifecycle events (session_start, session_heartbeat, session_end) via manual properties writes. Every other event, custom Track() calls, Identify(), Alias(), and built-ins like game_launch, shipped with zero session correlation. Every event should carry it consistently so a session can be reconstructed with a plain equality join instead of per-event-type special-casing.What
sessionIdis now on the top-level envelope for every message type: Track, Identify, Alias, sourced from the active session so no call site has to remember to add it. The existingproperties["session_id"]writes on the three lifecycle events are kept unchanged, Unity carries the field in both places for now (the web SDK equivalent dropped its nested field entirely after confirming nothing downstream depends on it).Linear: SDK-627
Test plan
dotnet test src/Audience.Build/Audience.Tests/Audience.Tests.csproj)