Skip to content

Commit 29b9f2e

Browse files
docs(audience): comment Initialized, UserId, SessionId getters
- `Initialized`: true once Init() finishes; false before Init / after Shutdown. - `UserId`: cleared by Reset and any consent downgrade out of Full. - `SessionId`: new ID at Init, Reset, on resume from a long-enough background pause, and on granting consent from None. Plain-language style matches the audience-diagnostics docs follow-up. Addresses PR #709 review: three getters lacked the per-member docs that the other public diagnostics getters already carry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a89f987 commit 29b9f2e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/Packages/Audience/Runtime/ImmutableAudience.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,18 @@ public static class ImmutableAudience
5656
// zero-value default (false / null / 0 / ConsentLevel.None) outside
5757
// Init..Shutdown. Values are tick-level snapshots, not invariants.
5858

59+
// True once Init() has finished setting things up. False before
60+
// Init() and after Shutdown().
5961
public static bool Initialized => _initialized;
6062

6163
// Persisted value, which may differ from AudienceConfig.Consent if
6264
// a prior session changed it.
6365
public static ConsentLevel CurrentConsent => _state.Level;
6466

67+
// The user ID from the most recent Identify() call. Becomes null
68+
// after Reset(), and also when consent drops from Full down to
69+
// Anonymous or None (since anonymous tracking must not know who
70+
// the user is).
6571
public static string? UserId => _state.UserId;
6672

6773
// Display-only — Reset and SetConsent(None) wipe it, so it is not
@@ -78,6 +84,11 @@ public static string? AnonymousId
7884
}
7985
}
8086

87+
// The current session's ID. A new ID is assigned each time a
88+
// session starts: at Init(), at Reset(), and when the app resumes
89+
// from the background after the previous session has timed out.
90+
// Null while consent is None — granting consent starts a fresh
91+
// session.
8192
public static string? SessionId => _session?.SessionId;
8293

8394
// Memory + disk counts are read without holding the drain lock, so

0 commit comments

Comments
 (0)