Skip to content

feat(braze_audience): sync through /users/track when the account chooses standard - #5801

Merged
bgolubovic-rs merged 3 commits into
developfrom
feat/braze-audience-standard-endpoint
Nov 18, 2026
Merged

bgolubovic-rs merged 3 commits into
developfrom
feat/braze-audience-standard-endpoint

Conversation

@bgolubovic-rs

@bgolubovic-rs bgolubovic-rs commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Explainer + 2-min walkthrough video (internal): https://claude.ai/artifact/4rAnmxYf4xqQzthUZbH4qP

BRAZE_AUDIENCE can now sync through Braze's standard /users/track endpoint, chosen per account via a new trackEndpoint option:

trackEndpoint Endpoint Batch cap Body
absent (accounts saved before this option) /users/track/bulk 1000 { attributes } (unchanged)
bulk /users/track/bulk 1000 { attributes }
standard /users/track 75 { partner: "RudderStack", attributes }
  • routerTransform.ts: resolves the endpoint once per destination in the constructor; getBatchStrategy picks 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's TRACK_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/track reports partial failures with the same errors[].index shape 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/bulk is 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/track works 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 trackEndpoint account 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 trackEndpoint keeps the bulk path, pinned by the existing component fixtures (which carry no trackEndpoint).

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/track and 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/track over bulk under load.

Existing accounts (saved before the option) have no trackEndpoint and 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 trackEndpoint value 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 trackEndpoint syncs through Bulk, because unset means Bulk here. Closing it later: backfill trackEndpoint: "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

npm test -- --testPathPattern="braze_audience" --no-coverage   62 passed
npm run test:ts -- component --destination=braze_audience      13 passed
npm run check:secret-paths                                      passes, no change

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:

Account trackEndpoint Request sent Braze
standard POST /users/track {"attributes":[…],"partner":"RudderStack"} 201 · attribute on profile · offered as a boolean filter in the segment builder
bulk POST /users/track/bulk {"attributes":[…]} 201 · attribute on profile
absent (account saved before this option) POST /users/track/bulk {"attributes":[…]} 201 · attribute on profile

trackEndpoint reaches destination.Config the same way dataCenter does; 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

…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
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2885deef-02ab-4004-9187-6a1069b184fe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.49%. Comparing base (8ddb21c) to head (b62c1de).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bgolubovic-rs
bgolubovic-rs marked this pull request as ready for review November 17, 2026 12:33
@bgolubovic-rs
bgolubovic-rs requested review from a team as code owners November 17, 2026 12:33
…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 arpl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_audience unit 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, partner on 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 before processDestinationIntegration builds the integration. So trackEndpoint is per destination, exactly like restApiKey and dataCenter already 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, transformerProxy on (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/track quota 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):

  1. The live CI job only exercises bulk. test/integrations/destinations/braze_audience/live/spec.ts doesn't set trackEndpoint, so live (braze_audience) never reaches /users/track. A second scenario with trackEndpoint: 'standard' would give the new default path live coverage (and would show whether /users/track really returns index/input_array, which Braze's docs don't state).
  2. A bad dataCenter now fails earlier. getTrackUrl runs in the constructor (routerTransform.ts), so a missing or invalid dataCenter throws for the whole group before validateInputs runs. 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 requires dataCenter); only the error shape changes. Computing the URL lazily would keep the per-record errors.
  3. 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 arpl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sonarqubecloud

Copy link
Copy Markdown

@lvrach lvrach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bgolubovic-rs
bgolubovic-rs merged commit 5549012 into develop Nov 18, 2026
38 checks passed
@bgolubovic-rs
bgolubovic-rs deleted the feat/braze-audience-standard-endpoint branch November 18, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants