Skip to content

Commit 3eac28d

Browse files
docs(audience-diagnostics): comment the bare diagnostic getters
Addresses PR #708 review: adds per-getter comments for `Initialized`, `UserId`, `SessionId` so all six public getters document their own non-obvious semantics, not just the three that did before. The block header above the getters still carries the shared contract (zero-value default outside Init..Shutdown, tick-level snapshot); the new lines only add what a reader cannot derive from the member name. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e8d3b55 commit 3eac28d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Packages/Audience/Runtime/ImmutableAudience.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,15 @@ 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+
// Flipped true at the end of a successful Init, false by Shutdown.
5960
public static bool Initialized => _initialized;
6061

6162
// Persisted value, which may differ from AudienceConfig.Consent if
6263
// a prior session changed it.
6364
public static ConsentLevel CurrentConsent => _state.Level;
6465

66+
// Last value passed to Identify(). Cleared by Reset and any consent
67+
// downgrade out of Full.
6568
public static string? UserId => _state.UserId;
6669

6770
// Display-only — Reset and SetConsent(None) wipe it, so it is not
@@ -78,6 +81,7 @@ public static string? AnonymousId
7881
}
7982
}
8083

84+
// Changes on extended-pause rollover. Also null while consent is None.
8185
public static string? SessionId => _session?.SessionId;
8286

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

0 commit comments

Comments
 (0)