Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wrangler) wrangler kv:key put does not work as expected #5619

Merged
merged 1 commit into from Apr 17, 2024

Conversation

gmemstr
Copy link
Contributor

@gmemstr gmemstr commented Apr 15, 2024

What this PR solves / how to test

Currently, when passing a path to kv:key put --path, the contents of the file are read in as a Buffer, which would normally be fine - however, when we also have --metadata defined, the payload is transformed into FormData. FormData can take a string, Blob or File, and will fall back to string for everything else. Because we loaded the file as a Buffer, the file contents are then transformed into a string by the library being used (undici). Normally this is okay unless you are not uploading a text-based document, e.g an image file.

Fixes #2911.

Author has addressed the following

Minor change correcting behaviour to what is expected

@gmemstr gmemstr requested a review from a team as a code owner April 15, 2024 21:36
Copy link

changeset-bot bot commented Apr 15, 2024

🦋 Changeset detected

Latest commit: 9c57876

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
wrangler Patch
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Apr 17, 2024

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8728909223/npm-package-wrangler-5619

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5619/npm-package-wrangler-5619

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8728909223/npm-package-wrangler-5619 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8728909223/npm-package-create-cloudflare-5619 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8728909223/npm-package-cloudflare-kv-asset-handler-5619
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8728909223/npm-package-miniflare-5619
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8728909223/npm-package-cloudflare-pages-shared-5619
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8728909223/npm-package-cloudflare-vitest-pool-workers-5619

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.51.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240405.2
workerd 1.20240405.0 1.20240405.0
workerd --version 1.20240405.0 2024-04-05

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@gmemstr gmemstr force-pushed the patch-1 branch 2 times, most recently from 307178a to 7d96f7c Compare April 17, 2024 09:29
@gmemstr gmemstr force-pushed the patch-1 branch 7 times, most recently from 58eca2e to 5282b66 Compare April 17, 2024 21:12
@Skye-31
Copy link
Contributor

Skye-31 commented Apr 17, 2024

@Skye-31 Skye-31 merged commit 6fe0af4 into cloudflare:main Apr 17, 2024
15 checks passed
@gmemstr gmemstr deleted the patch-1 branch April 17, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

🐛 BUG: wrangler kv:key put does not work as expected
3 participants