Skip to content

feat(audience): SDK-220 retrofits — gzip gate, Log, JsonReader, paths, comments#692

Merged
ImmutableJeffrey merged 5 commits into
mainfrom
feat/sdk-147-singleton-1
Apr 21, 2026
Merged

feat(audience): SDK-220 retrofits — gzip gate, Log, JsonReader, paths, comments#692
ImmutableJeffrey merged 5 commits into
mainfrom
feat/sdk-147-singleton-1

Conversation

@ImmutableJeffrey
Copy link
Copy Markdown
Collaborator

@ImmutableJeffrey ImmutableJeffrey commented Apr 21, 2026

Summary

  • Gates gzip transport behind an IMMUTABLE_AUDIENCE_GZIP scripting define.
  • Converts remaining XML doc comments to plain // style.
  • Centralises imtbl_audience/* path construction in AudiencePaths.
  • Adds an IL2CPP-safe JsonReader utility.
  • Adds a Log utility with an injectable writer.

Linear: SDK-220, SDK-216 (the //-style convention applied here is the chosen resolution for SDK-216's "use /// <summary>" ask on the audience surface).

ImmutableJeffrey and others added 5 commits April 22, 2026 03:51
Plan §6.7 has v1 shipping plain UTF-8 JSON because
platform-services/services/audience does not yet decompress
Content-Encoding: gzip on POST /v1/audience/messages. Sending a gzipped
body today returns 400 for every batch.

Guards the gzip path, the Gzip utility, and the gzip-specific tests
behind the scripting define IMMUTABLE_AUDIENCE_GZIP. Default (flag off)
sends plain JSON with no Content-Encoding header. Flip the define on
once the backend middleware lands.

- HttpTransport: wraps the gzip branch in #if; the default branch uses
  StringContent plain JSON.
- Gzip.cs and GzipTests.cs compile only under the flag.
- HttpTransportTests: gzip assertion tightened to check Content-Encoding.
  Adds a default-path test asserting no Content-Encoding is set and the
  body parses as plain JSON.

Verified:
- dotnet test: 151 passed (default, gzip off)
- dotnet test -p:DefineConstants=IMMUTABLE_AUDIENCE_GZIP: 154 passed

Linear: SDK-147

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Converts the remaining XML doc comments in the already-merged SDK
pieces (DiskStore, EventQueue, HttpTransport, Gzip, Constants,
ConsentLevel, AudienceConfig, ImmutableAudience scaffold, and the
transport tests) to plain // comments. Brings them in line with the
style used by the incoming SDK-147 commits.

No behaviour change.
Adds Core/AudiencePaths.cs as the single source of truth for the
imtbl_audience/{identity,consent,queue} on-disk layout. Replaces
Identity's hardcoded Path.Combine calls with AudiencePaths.IdentityFile
and AudiencePaths.AudienceDir. Prepares the namespace for consent and
queue path consumers that land in subsequent commits.
Complements the existing Utility/Json writer with a reader half.
Reflection-free — parses the subset of JSON that Json.cs emits
(objects, strings, numbers, booleans, null, arrays). Throws
FormatException on malformed input. Used wherever the SDK needs
to deserialise its own previously-written payloads.
Debug/Warn logger used by SDK internals for diagnostics. Writer is
injectable so tests can capture output and AudienceUnityHooks can
install Debug.Log as the sink under Unity. Debug calls are gated
by an Enabled toggle (AudienceConfig.Debug); Warn always emits.
Falls back to Console.WriteLine when no Writer is installed so
headless .NET consumers still see output.
@ImmutableJeffrey ImmutableJeffrey marked this pull request as ready for review April 21, 2026 22:45
@ImmutableJeffrey ImmutableJeffrey requested review from a team as code owners April 21, 2026 22:45
@ImmutableJeffrey ImmutableJeffrey merged commit 43a4976 into main Apr 21, 2026
18 checks passed
@ImmutableJeffrey ImmutableJeffrey deleted the feat/sdk-147-singleton-1 branch April 21, 2026 23:00
@nattb8 nattb8 changed the title feat(audience): SDK-141 retrofits — gzip gate, Log, JsonReader, paths, comments feat(audience): SDK-220 retrofits — gzip gate, Log, JsonReader, paths, comments Apr 22, 2026
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