Skip to content

test(braze_audience): standard live cleanup via /users/track; real oversized id in fixture - #5803

Merged
bgolubovic-rs merged 1 commit into
developfrom
test/braze-audience-standard-live-cleanup
Nov 19, 2026
Merged

bgolubovic-rs merged 1 commit into
developfrom
test/braze-audience-standard-live-cleanup

Conversation

@bgolubovic-rs

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Test-only follow-up to the two Braze Audience review comments on the v1.170.0 release PR (#5802, comments r4611958140 and r4611958222). No production code changes.

  • Live cleanup uses the scenario's own endpoint (live/api.ts, live/spec.ts). setMembership takes the endpoint (standard / bulk, from TRACK_ENDPOINT_SPECS, with partner on standard), and the two standard scenarios clean up with clearMembershipVia('standard'). Before, they cleaned up through /users/track/bulk, which fails on a key that only holds users.track, and the best-effort cleanup then left the test attribute set.
  • Standard dataDelivery case uses a genuinely oversized external_id (dataDelivery/network.ts, data.ts). The mocked EXTERNAL_USER_ID_TOO_LARGE now matches an id over Braze's 988-byte cap, and the invented transient error is dropped; the bulk cases already cover retryable indexed errors through the same delivery handler. The real Braze behaviour stays covered by the live braze-audience-standard-partial-failure scenario.

What is the related Linear task?

ACT2-1540

Please explain the objectives of your changes below

Keep the standard-endpoint tests honest: cleanup must work with the permission a Standard account actually has, and the component fixture should model an input Braze would really reject.

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

None. Test code only.

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?

N/A

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

The live job (live (braze_audience)) runs on this PR with the CI Braze key.


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

…ersized id in fixture

Follow-up to review comments on the v1.170.0 release PR (#5802):
- Live cleanup (and setMembership) now posts to the endpoint the scenario
  syncs with. The standard scenarios cleaned up through /users/track/bulk,
  which fails on a key that only holds users.track.
- The standard dataDelivery case now sends an external_id over Braze's
  988-byte cap, so the mocked EXTERNAL_USER_ID_TOO_LARGE matches an input
  Braze rejects, and drops the invented transient error (the bulk cases
  already cover retryable indexed errors through the same handler).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Scanned-by: gitleaks 8.30.1
@bgolubovic-rs
bgolubovic-rs requested review from a team as code owners November 18, 2026 10:03
Copilot AI balanced review requested due to automatic review settings November 18, 2026 10:03
@coderabbitai

coderabbitai Bot commented Nov 18, 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: 86413b98-65eb-4ab2-8bb6-30421ea3a74c

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the test-only updates to Braze Audience’s endpoint-aware cleanup and partial-failure fixtures.

No open issues 🎉

What changed in this PR

This test-only follow-up makes Braze Audience’s standard-endpoint tests more realistic and ensures cleanup uses the same endpoint permissions as the scenario. Production behavior is unchanged.

Changes:

  • Route standard live-scenario cleanup through /users/track, including its partner field.
  • Replace the mocked oversized identity with an external_id exceeding Braze’s 988-byte limit.
  • Remove the synthetic transient-error case and align expected delivery results with the two-record fixture.
File Description
test/​integrations/​destinations/​braze_audience/​live/​spec.ts Selects standard-endpoint cleanup for both standard scenarios.
test/​integrations/​destinations/​braze_audience/​live/​api.ts Adds endpoint-aware membership updates and cleanup helpers.
test/​integrations/​destinations/​braze_audience/​dataDelivery/​network.ts Uses a genuinely oversized ID and removes the synthetic transient error.
test/​integrations/​destinations/​braze_audience/​dataDelivery/​data.ts Updates metadata and expected results for the revised partial-failure fixture.

Review effort: Balanced

@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.49%. Comparing base (5549012) to head (6e95cb6).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5803   +/-   ##
========================================
  Coverage    92.49%   92.49%           
========================================
  Files          742      742           
  Lines        41358    41358           
  Branches      9654     9742   +88     
========================================
  Hits         38254    38254           
+ Misses        2921     2843   -78     
- Partials       183      261   +78     

☔ 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.

@sonarqubecloud

Copy link
Copy Markdown

@bgolubovic-rs
bgolubovic-rs requested a review from arpl November 19, 2026 10:18
@bgolubovic-rs
bgolubovic-rs merged commit 0c6a7eb into develop Nov 19, 2026
39 checks passed
@bgolubovic-rs
bgolubovic-rs deleted the test/braze-audience-standard-live-cleanup branch November 19, 2026 10:20
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