You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(audience-sdk): centralise log message text in AudienceLogs (SDK-272)
Adds an internal AudienceLogs class in Runtime/Utility/Log.cs as the
single source of truth for runtime log message strings. Runtime
callers in ImmutableAudience.cs, Session.cs, and HttpTransport.cs now
read from AudienceLogs constants and methods instead of inline
literals, and the test assertions read from the same place so
wording changes touch one file.
- Every Log.Warn / Log.Debug call site across ImmutableAudience,
Session, and HttpTransport migrated.
- Test assertions in ImmutableAudienceTests, PublishableKeyPrefixTests,
and SessionTests now reference AudienceLogs constants directly.
- HttpTransport.NotifyError and ImmutableAudience.NotifyErrorCallback
now share the OnErrorThrew template; HttpTransport's prior wording
carried an incidental underscore (_onError) from the field name and
is dropped during the migration. Both situations are "the
consumer's error handler threw inside our notify path" so they read
from one constant.
- Three negative-path tests in PublishableKeyPrefixTests previously
asserted that no key-mismatch warning fired by checking lines for
the substring "BaseUrl". The substring is incidental to the message
wording; an unrelated future log line that mentions "BaseUrl" would
silently trip the test. Switched to assert against the actual
AudienceLogs.TestKeyAgainstProduction and
AudienceLogs.NonTestKeyAgainstSandbox constants.
The class lives alongside Log in Log.cs (rather than its own file)
to keep the Audience runtime package's asset import surface
unchanged, since adding a fresh .cs/.meta pair triggered a Win64 +
Unity 6 PlayMode timing flake during sample-app UI Toolkit init on
this PR.
No code behaviour changes; wire format and OnError contract are
untouched. dotnet test passes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments