Repository navigation
feat(braze_audience): sync through /users/track when the account chooses standard - #5801
Conversation
…ses standard Braze has stopped enrolling new workspaces in the /users/track/bulk beta. Read the account's trackEndpoint (rudder-integrations-config): `standard` batches to /users/track at the event-stream braze cap of 75 with the RudderStack partner field; `bulk` keeps today's 1000-item bulk path. An account without the field keeps syncing through bulk. Partial-failure handling is unchanged: /users/track reports per-record errors with the same `errors[].index` shape on a 2xx. Co-Authored-By: Claude Opus 5.5 <[email protected]> Scanned-by: gitleaks 8.30.1
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5801 +/- ##
========================================
Coverage 92.49% 92.49%
========================================
Files 742 742
Lines 41350 41358 +8
Branches 9653 9738 +85
========================================
+ Hits 38246 38254 +8
Misses 2921 2921
Partials 183 183 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…artial delivery - TRACK_ENDPOINT_SPECS holds the path, batch size and partner field per endpoint, so the batch strategy and body builder read the resolved spec instead of comparing path strings. - An unknown trackEndpoint still resolves to bulk at construction; input validation rejects it. - MAX_PAYLOAD_SIZE comment now says it applies to both endpoints. - dataDelivery: a /users/track 201 with indexed errors aborts the identity error, retries the other one and succeeds the rest. Co-Authored-By: Claude Opus 5.5 <[email protected]> Scanned-by: gitleaks 8.30.1
arpl
left a comment
There was a problem hiding this comment.
Approving at 4d3cd757. The spec-per-endpoint refactor reads well, and the new Standard partial-delivery fixture covers the case I was going to ask for.
Checked:
- Tests: on the head (Node 22),
braze_audienceunit 62/62 and component 13/13. - Mutations: 6 mutations against the first head, all killed by the tests: cap flip, dropping
partner, defaulting to standard, a silent fallback on unknown values,partneron bulk, and a 100 cap. - Edge values:
null,"","Standard"and"BULK"each give a 400 per record from zod. None of them can be stored, because the account schema rejects them. - Mixed accounts in one router call: not an issue.
groupRouterTransformEvents(src/v0/util/index.js:2506-2510) splits by destination ID beforeprocessDestinationIntegrationbuilds the integration. SotrackEndpointis per destination, exactly likerestApiKeyanddataCenteralready are. - Delivery: 429 → throttled, 5xx → retry, 4xx (including 403 for a key without the permission) → abort, and indexed
errors[]on a 2xx are classified per record. None of this depends on the endpoint. - Prod router config:
noOfJobsToBatchInAWorker: 1000, 4 workers,transformerProxyon (rudderstack-operator), so a 1000-job batch becomes 14 sequential requests on Standard. That's nowhere near Braze's burst limit, but on a small MAU contract the hourly/users/trackquota is shared with the customer's other traffic. A 429 retries, so this only slows the sync and never loses data. Worth a line in ACT2-1549.
Nits (non-blocking):
- The live CI job only exercises bulk.
test/integrations/destinations/braze_audience/live/spec.tsdoesn't settrackEndpoint, solive (braze_audience)never reaches/users/track. A second scenario withtrackEndpoint: 'standard'would give the new default path live coverage (and would show whether/users/trackreally returnsindex/input_array, which Braze's docs don't state). - A bad
dataCenternow fails earlier.getTrackUrlruns in the constructor (routerTransform.ts), so a missing or invaliddataCenterthrows for the whole group beforevalidateInputsruns. On base it was a per-record zod 400. The outcome is the same (400, aborted) and this is hard to reach (the account schema requiresdataCenter); only the error shape changes. Computing the URL lazily would keep the per-record errors. - Merge this one before rudder-integrations-config#2910 (see that review for the narrow window).
Not run live by the review: I had no Braze key, so A1 (Standard on a workspace without the bulk beta) rests on your QA-workspace run, and that workspace has the beta enabled.
…dpoint The live job only exercised bulk, so the endpoint new accounts are steered to had no live coverage. Adds a standard join (asserts the request path is /users/track and the attribute lands) and a standard partial failure (valid + oversized external_id in one request; only index 1 must fail), which checks that /users/track reports per-record errors with an index, as the delivery handler assumes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Scanned-by: gitleaks 8.30.1
arpl
left a comment
There was a problem hiding this comment.
Re-reviewed at b62c1de9 (test-only: two Standard live scenarios). live (braze_audience) passed against real Braze, 11/11. On Standard, an insert through /users/track lands on the profile, and a batch with one oversized external_id fails only index 1. So /users/track really does return indexed errors, which closes my live-coverage nit and the open question on the error shape. One thing still left: the live workspace has the bulk beta enabled, so a Standard sync on a workspace without it is worth one run before telling the customer. Merge this before rudder-integrations-config#2910. Still approved.
|
lvrach
left a comment
There was a problem hiding this comment.
Approved at b62c1de. I have nothing to add to the earlier review.
I read the batching and the delivery mapping for both endpoints. An account with no trackEndpoint keeps the bulk path unchanged, 76 records split into 75 and 1 on standard, and errors[].index maps to the right record in each batch. I ran no tests.



What are the changes introduced in this PR?
Explainer + 2-min walkthrough video (internal): https://claude.ai/artifact/4rAnmxYf4xqQzthUZbH4qP
BRAZE_AUDIENCEcan now sync through Braze's standard/users/trackendpoint, chosen per account via a newtrackEndpointoption:trackEndpoint/users/track/bulk{ attributes }(unchanged)bulk/users/track/bulk{ attributes }standard/users/track{ partner: "RudderStack", attributes }routerTransform.ts: resolves the endpoint once per destination in the constructor;getBatchStrategypicks the cap from it.config.ts:TRACK_ENDPOINT_SPECS— one entry per endpoint (path, records per request,partner). Standard's 75 cap and partner name come from the event-stream braze destination'sTRACK_BRAZE_MAX_REQ_COUNT/BRAZE_PARTNER_NAME, so the two cannot drift.types.ts:trackEndpoint: z.enum(['standard', 'bulk']).optional()on the account config.delivery.ts: comment only./users/trackreports partial failures with the sameerrors[].indexshape on a 2xx, so per-record verdicts are unchanged.What is the related Linear task?
ACT2-1540
Please explain the objectives of your changes below
/users/track/bulkis a Braze limited beta that a Braze workspace must be enrolled in, and Braze is currently not enrolling new workspaces. Every new Braze Audience customer is blocked until then./users/trackworks on every workspace.Bulk stays the long-term target and the default for existing accounts; standard is offered alongside it.
Dependent change: rudderlabs/rudder-integrations-config#2910 — adds the
trackEndpointaccount option. Merge and deploy this PR first. Without the config change no account carries the field, so behaviour is unchanged. The other way round, an account saved as Standard with a bulk-only key syncs through bulk until this deploys, then starts failing with 403.Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
None for existing accounts: an absent
trackEndpointkeeps the bulk path, pinned by the existing component fixtures (which carry notrackEndpoint).Rollback: rolling this transformer change back is the risky direction. Accounts that already store
trackEndpoint: "standard"would go back to/users/track/bulk, and those on workspaces without Braze's bulk beta would get 403 until it is redeployed. Rolling back rudderlabs/rudder-integrations-config#2910 is harmless: stored values stay, and only new accounts lose the select.partner: "RudderStack"is sent on standard bodies only — it is documented for/users/trackand already sent by the event-stream braze destination; the bulk schema does not list it.Any new dependencies introduced with this change?
N/A
Any new generic utility introduced or modified. Please explain the changes.
N/A
Any technical or performance related pointers to consider with the change?
Standard sends up to ~13x more requests than bulk for the same audience (75 vs 1000 per request). Braze data-point billing is identical across the two endpoints. Braze prioritises
/users/trackover bulk under load.Existing accounts (saved before the option) have no
trackEndpointand keep syncing through Bulk. Editing one in Lookout or the web app now requires choosing a Sync endpoint (nothing preselected, see rudderlabs/rudder-integrations-config#2910), so nothing switches them to Standard by accident.An unknown
trackEndpointvalue fails schema validation (400 per record) rather than silently falling back; config-backend enforces the same enum on the account.Remaining gap (small follow-up)
An account created through the API without
trackEndpointsyncs through Bulk, because unset means Bulk here. Closing it later: backfilltrackEndpoint: "bulk"on existing accounts (DB update + per-workspace config cache rebuild,DELETE /admin/workspaces/:id/config/cache; a raw update alone is not picked up by the data plane), then make unset mean Standard.Testing
New: unit cases for absent / bulk / standard endpoint + body, 76 records splitting 75 + 1 on standard vs one request on bulk, unknown value rejected; one standard component router case; one dataDelivery case for a Standard request where Braze rejects some records (2xx +
errors[].index).End-to-end (local stack, real Braze QA workspace with the bulk beta enabled)
Accounts created through the account APIs and both account UIs, audiences built and activated from Lookout, syncs run, outbound requests captured with transformer
LOG_LEVEL=event, attributes read back with/users/export/ids:trackEndpointstandardPOST /users/track{"attributes":[…],"partner":"RudderStack"}bulkPOST /users/track/bulk{"attributes":[…]}POST /users/track/bulk{"attributes":[…]}trackEndpointreachesdestination.Configthe same waydataCenterdoes; no rudder-server or config-backend change needed.Developer checklist
My code follows the style guidelines of this project
No breaking changes are being introduced.
All related docs linked with the PR?
All changes manually tested?
Any documentation changes needed with this change?
Is the PR limited to 10 file changes?
Is the PR limited to one linear task?
Are relevant unit and component test-cases added in new readability format?
Reviewer checklist
Is the type of change in the PR title appropriate as per the changes?
Verified that there are no credentials or confidential data exposed with the changes.
🤖 Generated with Claude Code