Skip to content

fix(audience-transport): surface 4xx body + messages envelope#710

Merged
ImmutableJeffrey merged 1 commit intofeat/audience-envfrom
feat/audience-transport-4xx
Apr 24, 2026
Merged

fix(audience-transport): surface 4xx body + messages envelope#710
ImmutableJeffrey merged 1 commit intofeat/audience-envfrom
feat/audience-transport-4xx

Conversation

@ImmutableJeffrey
Copy link
Copy Markdown
Collaborator

@ImmutableJeffrey ImmutableJeffrey commented Apr 24, 2026

Summary

  • HttpTransport.SendBatchAsync — 4xx branch reads response.Content (truncated to 500 chars) and includes it in the onError message. Previously only the status code reached the callback, masking the backend's validation diagnostic (e.g. "invalid eventName format at /batch/0/eventName").
  • HttpTransport.BuildPayload — emits {"messages":[...]} instead of {"batch":[...]} to match the backend's MessagesRequest schema; every send was 400'ing before the fix.
  • HttpTransportTests — renames the URL-routing tests to env-explicit names (_DefaultEnvironment_HitsSandbox, _ExplicitDev_HitsDev, _ExplicitProduction_HitsProduction); asserts the 400 body reaches the onError callback.
  • HttpTransportTests and GzipTests fixtures updated to the {"messages":[...]} envelope.

Linear: SDK-245. Follow-up to SDK-234.

…...]} envelope

Two bugs that together kept the QuickStart sample from ever shipping
events successfully:

1. The 4xx branch of SendBatchAsync reported only the status code.
   Now reads response.Content (truncated to 500 chars) so the
   backend's validation message lands in the onError callback —
   no more silently dropped batches with "something is wrong" as
   the only signal.
2. BuildPayload wrapped events in {"batch":[...]}. The backend's
   MessagesRequest schema expects the top-level key "messages";
   every send 400'd. Envelope switched, tests updated, and the
   GzipTests fixture aligned to the real wire shape.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ImmutableJeffrey ImmutableJeffrey marked this pull request as ready for review April 24, 2026 04:48
@ImmutableJeffrey ImmutableJeffrey requested review from a team as code owners April 24, 2026 04:48
@ImmutableJeffrey ImmutableJeffrey merged commit 7dacbf1 into feat/audience-env Apr 24, 2026
18 checks passed
@ImmutableJeffrey ImmutableJeffrey deleted the feat/audience-transport-4xx branch April 24, 2026 04:49
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