Skip to content

test: cover sending a Buffer Actor input as raw bytes - #1078

Merged
vdusek merged 1 commit into
v3from
fix/buffer-body-serialization
Sep 25, 2026
Merged

vdusek merged 1 commit into
v3from
fix/buffer-body-serialization

Conversation

@vdusek

@vdusek vdusek commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Adds a regression test for #277: start() with a Buffer input and contentType: 'application/json' sends the raw bytes, and the server gets the decoded JSON back.

The bug itself is already gone on v3. serializeBody() from #1058 passes binary and string bodies through before it reaches JSON.stringify, and axios no longer re-serializes strings since #1051 set transformRequest: []. With the Buffer branch disabled, the new test fails with the { type: 'Buffer', data: [...] } payload from the issue.

Closes #277

✍️ Drafted by Claude Code

@vdusek vdusek added the t-tooling Issues with this label are in the ownership of the tooling team. label Sep 25, 2026
@vdusek vdusek self-assigned this Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ There are broken links in the documentation.

See more at https://github.com/apify/apify-client-js/actions/runs/36110964961#summary-107994094312

@vdusek
vdusek marked this pull request as ready for review September 25, 2026 08:13
@vdusek
vdusek requested a review from janbuchar September 25, 2026 08:13
@vdusek
vdusek merged commit 69b4ab6 into v3 Sep 25, 2026
8 checks passed
@vdusek
vdusek deleted the fix/buffer-body-serialization branch September 25, 2026 09:15
B4nan pushed a commit that referenced this pull request Sep 30, 2026
Adds a regression test for #277: `start()` with a `Buffer` input and
`contentType: 'application/json'` sends the raw bytes, and the server
gets the decoded JSON back.

The bug itself is already gone on `v3`. `serializeBody()` from #1058
passes binary and string bodies through before it reaches
`JSON.stringify`, and axios no longer re-serializes strings since #1051
set `transformRequest: []`. With the Buffer branch disabled, the new
test fails with the `{ type: 'Buffer', data: [...] }` payload from the
issue.

Closes #277

*✍️ Drafted by Claude Code*
vdusek added a commit that referenced this pull request Oct 2, 2026
#1099)

`ActorInput` was an alias for `object`, so a `Date`, `Map`, `Set` or
function compiled and then went out as a wrong body or threw. It's now
`Dictionary | Dictionary[] | Uint8Array`, which is the type suggested in
#1054 plus `Uint8Array`. The extra member keeps raw-bytes input
compiling (a `Buffer` sent with a `contentType`, see #277 and #1078).

This is a breaking change for input declared as an `interface`.
Interfaces get no implicit index signature, so they don't match
`Dictionary`. The v3 migration guide shows the fix, either a `type`
alias or a spread (`{ ...input }`).

A type test pins the accepted and rejected shapes.

This doesn't touch `contentType`, the other half of #1054. The platform
still stores the `INPUT` record under the content type it receives.

Closes: #1054

*✍️ Drafted by Claude Code*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants