cloudflare / cloudflare/developer-platform

🐛 BUG: R2 Multipart upload doesn't return custom metadata

オープン
#3 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る
product:r2
主要言語
言語のデータがありません
スター
1
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

説明

### Which Cloudflare product(s) does this pertain to?

R2

### What version(s) of the tool(s) are you using?

3.57.2 Wrangler

### What version of Node are you using?

20.12.2

### What operating system and version are you using?

Windows 11

### Describe the Bug

### Observed behavior
Custom metadata is missing when completing a R2 multipart upload. However when fetching the head of the r2Object the metadata is there. Strangely enough when running locally with `wrangler pages dev` the example works as expected. Only once you deploy your site the custom metadata is missing.

```js
const upload = await env.BUCKET.createMultipartUpload(key, {
customMetadata: {
hallo: 'zwallo',
},
});

const uploadPart = await upload.uploadPart(1, request.body);

const r2Object = await upload.complete([uploadPart]);
console.log(r2Object.customMetadata) // logs an empty object: {}

const r2Head = await env.BUCKET.head(key);
console.log(r2Head.customMetadata) // logs the correct metadata: {hallo: "zwallo"}
```

### Expected behavior
`multipartUpload.complete()` should return an `R2Object` with the field `customMetadata` populated

### Steps to reproduce
1. clone repository
2. run `cd multipart-upload-missing-metadata && npm i`
3. run `npm run dev` for a working example
4. run `npm run deploy` for the example to fail on the deployed site

### Please provide a link to a minimal reproduction

https://github.com/YannicEl/cloudflare_worker_bugs/tree/main/multipart-upload-missing-metadata

### Please provide any relevant error logs

_No response_

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

multipart-upload-missing-metadata の再現から始め、npm i で依存関係をインストールします。npm run dev と npm run deploy を実行し、multipartUpload.complete() が返す customMetadata と head() のメタデータを比較します。デプロイされた例が値の入ったメタデータを返せば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, node.js
領域
api, backend, cloud
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
32/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。