feat(audience): mirror server-side event validation client-side [SDK-679]#2905
Merged
Conversation
|
View your CI Pipeline Execution ↗ for commit e01a327
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
✅ Pixel Bundle Size — @imtbl/pixel
Budget: 10.00 KB gzipped (warn at 8.00 KB) |
|
| Metric | Size | Delta vs main (f397e7d) |
|---|---|---|
| Gzipped | 21110 bytes (20.61 KB) | +364 bytes |
| Raw (minified) | 61434 bytes | +1087 bytes |
Budget: 24.00 KB gzipped (warn at 20.00 KB)
⚠️ Approaching budget — gzipped size exceeds 20.00 KB warning threshold.
nattb8
force-pushed
the
feat/sdk-679-mirror-server-validation
branch
2 times, most recently
from
July 20, 2026 04:42
5f44585 to
c59ee98
Compare
nattb8
marked this pull request as ready for review
July 20, 2026 04:50
nattb8
force-pushed
the
feat/sdk-679-mirror-server-validation
branch
from
July 20, 2026 04:54
c59ee98 to
9fb53c5
Compare
Brings client-side validation to parity with the ingest API so bad events are caught and dropped locally instead of round-tripping to the server just to be rejected. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
nattb8
force-pushed
the
feat/sdk-679-mirror-server-validation
branch
from
July 20, 2026 06:22
9fb53c5 to
e01a327
Compare
JCSanPedro
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ticket: SDK-679
Brings client-side validation in
@imtbl/audienceand@imtbl/pixelto parity with the ingest API. Invalid calls (bad id, wrong identity type, unrecognised consent level, etc.) now throw immediately instead of dropping silently with a console warning that's easy to miss in normal development; valid calls are unaffected and still enqueue as before. The passport-ID format check already covered part of this scope (predates this PR); this closes the rest.alias()equality checkidentityTypeboth matchedtrack()'s event name,identify()'s id,alias()'s ids)identityType/fromType/toType, consent levelcollectContext()fields (userAgent,pageUrl,pagePath,pageReferrer,pageTitle)pageUrlwas a realistic way to get a message rejected server-sideThe two rows above the divider are the ones that changed from warn-and-drop to throw. The bottom two (stale queued messages, context field truncation) have no synchronous caller to throw to — those still report via
onError/truncate silently, unchanged.Also fixed the sample app (
sdk-sample-app): its ownonAlias()had a duplicate pre-check hardcoding the old equality rule (id + type both had to match), and aconsole.warn-sniffing hack to detect a droppedidentify()call. Both are gone now: the pre-check matches the current rule, andidentify()/alias()failures are caught directly from the thrown error like any other SDK call.Test plan
nx testpasses: core (278), sdk (108 + 5 CDN-artifact), pixel (51) — includes new coverage for every row above, converted fromconsole.warnspies toexpect(...).toThrow()nx lintpasses across core, sdk, pixeltsc --noEmit(typecheck) passes across all three packages, including the pinned type-level invariants insdk.test-d.tsnx buildpasses across all three packages🤖 Generated with Claude Code