You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(destination): reject conflicting delivery body formats - #5784
Add a shared one-format guard for JSON, JSON_ARRAY, XML, FORM, and GZIP. The post-transformation success handler checks native and CDK v2 processor outputs; router outputs and native batch outputs are also checked before delivery.
What is the related Linear task?
Resolves INT-6922
Please explain the objectives of your changes below
Prevent ambiguous delivery when a builder emits more than one non-empty body format. This foundational change blocks INT-6924 and INT-6926.
Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
Router validation checks every 2xx response, including one with an error key. A conflicting router response becomes a failure retaining its own metadata and destination. It uses the destination group's existing error details and router stats loop. A conflicting native batch output follows the existing retryable 500 batch failure path, with the failure metadata scoped to its own destination group. Existing router tag precedence and native processor and batch failure metrics are unchanged. Single-format outputs are unchanged.
Any new dependencies introduced with this change?
None.
Any new generic utility introduced or modified. Please explain the changes.
validateDeliveryRequestBody checks single or array requests using the proxy's lodash emptiness rule and throws a PlatformError naming the conflicting formats.
Any technical or performance related pointers to consider with the change?
A conflicting nested router request fails its enclosing response because nested requests share metadata. In native batch transformation, a conflict goes through the existing batch catch. CDK v2 increments event_transform_success before calling the shared processor success handler, so a guard rejection also increments event_transform_failure. No builders or transport selection logic were changed.
Validation
npm run lint — passed.
Focused destination service and guard Jest tests — passed.
TypeScript build checks — passed.
Full component suite — 4,144 passed, 2 skipped.
Live mini integration verification skipped: the transformer source change cannot be built from its SHA-pinned Docker base in this sandbox; a stock service would not exercise the edit.
⚠️ Known Issues
The changed transformer was not exercised end-to-end on mini because its source build is unavailable in this sandbox. Focused and component tests passed; live behavior remains to be checked in a source-capable environment.
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? No.
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.
👋 I'm rudder-devbox. I opened this PR from task INT-6922.
Mention @devbox or @rudder-devbox and I'll act on it — on a top-level PR comment,
in a review summary, or on an inline comment on the diff. Without a mention I won't see it.
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: 6f72bd01-adad-4b60-9237-a46b3b7be158
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.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
A destination-group conflict incorrectly includes every input job in the failure response, causing jobs in healthy groups to receive contradictory failure and success outcomes.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
A destination-group conflict incorrectly includes unrelated jobs in the retryable failure response, giving successful jobs contradictory outcomes and unnecessary retries.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The new validation incorrectly treats customer-data keys in raw storage events as delivery-format selectors, causing valid S3 and Azure Blob events to fail with non-retryable 400 errors.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Rejecting raw events with JSON and FORM keys breaks storage destinations
This handler also receives raw events from destinations such as S3 and Azure Blob (src/v0/destinations/s3/transform.js returns event.message unchanged). A valid event containing customer data such as body: { JSON: { id: 1 }, FORM: { id: 2 } } now becomes a non-retryable 400, even though these keys are not delivery-format selectors for those destinations. Restrict this check to delivery request envelopes, and add a raw-event regression case so storage destinations retain their pass-through behavior.
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
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.
What are the changes introduced in this PR?
Add a shared one-format guard for JSON, JSON_ARRAY, XML, FORM, and GZIP. The post-transformation success handler checks native and CDK v2 processor outputs; router outputs and native batch outputs are also checked before delivery.
What is the related Linear task?
Resolves INT-6922
Please explain the objectives of your changes below
Prevent ambiguous delivery when a builder emits more than one non-empty body format. This foundational change blocks INT-6924 and INT-6926.
Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
Router validation checks every 2xx response, including one with an
errorkey. A conflicting router response becomes a failure retaining its own metadata and destination. It uses the destination group's existing error details and router stats loop. A conflicting native batch output follows the existing retryable 500 batch failure path, with the failure metadata scoped to its own destination group. Existing router tag precedence and native processor and batch failure metrics are unchanged. Single-format outputs are unchanged.Any new dependencies introduced with this change?
None.
Any new generic utility introduced or modified. Please explain the changes.
validateDeliveryRequestBodychecks single or array requests using the proxy's lodash emptiness rule and throws aPlatformErrornaming the conflicting formats.Any technical or performance related pointers to consider with the change?
A conflicting nested router request fails its enclosing response because nested requests share metadata. In native batch transformation, a conflict goes through the existing batch catch. CDK v2 increments
event_transform_successbefore calling the shared processor success handler, so a guard rejection also incrementsevent_transform_failure. No builders or transport selection logic were changed.Validation
npm run lint— passed.Developer checklist
Reviewer checklist