Skip to content

Conversation

pedro-stramantinoli
Copy link
Contributor

@pedro-stramantinoli pedro-stramantinoli commented Aug 25, 2025

This PR is related to this feature.

Basically it should allow to call batch API with header x-batch-validation.
If the header value is permissive, it should expect to receive a field errors with data.
This should NOT cause a breaking change.

For that, if no header is provided, we guarantee that no field errors will be returned.


Summary by cubic

Adds a permissive mode to the Batch API. When clients send x-batch-validation=permissive, responses can include an errors array for partial failures; without it, the SDK omits errors to preserve the old response shape (no breaking change).

  • New Features
    • Forwards custom headers in batch.create (adds PostOptions.headers).
    • Adds optional errors[] to CreateBatchSuccessResponse typing.
    • Strips errors from responses unless permissive mode is used.
    • Adds tests for permissive mode and backward compatibility, plus a mockSuccessWithStatusCode helper.

Copy link

pkg-pr-new bot commented Aug 25, 2025

Open in StackBlitz

npm i https://pkg.pr.new/resend/resend-node/resend@599

commit: baafc52

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

3 issues found across 5 files

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

… based on the option (#605)

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Copy link
Member

@gabrielmfern gabrielmfern left a comment

Choose a reason for hiding this comment

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

LGTM! But since I made so many changes I think it would be nice to get the eyes of somebody else too

@pedro-stramantinoli pedro-stramantinoli merged commit 722feb3 into canary Aug 29, 2025
10 checks passed
@pedro-stramantinoli pedro-stramantinoli deleted the feat/batch-mode-permissive branch August 29, 2025 13:18
gabrielmfern added a commit that referenced this pull request Sep 15, 2025
Co-authored-by: Gabriel Miranda <[email protected]>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
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.

2 participants