workers-rs icon indicating copy to clipboard operation
workers-rs copied to clipboard

[BUG] R2 put() never completes in dev mode

Open buchgr opened this issue 2 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

What version of workers-rs are you using?

0.0.18

What version of wrangler are you using?

3.5.1

Describe the bug

My worker writes to an R2 bucket.

[[r2_buckets]]
binding = "FOO"
bucket_name = "foo"
preview_bucket_name = "foo-test"
let bucket = ctx.bucket("FOO")?;
console_log!("before");
let res = bucket.put("bar", vec![1,2,3,4]).execute().await?;
console_log!("after");

The above code works as expected in production, but bucket.put() hangs indefinitely when in dev mode (npx wrangler dev). However, listing all keys of the bucket prints ["bar"]. Accessing the object's body errors. When I inspect the bucket in the CF dashboard it doesn't show bar.

let objs = bucket.list().execute().await?;
console_log!("{:?}", objs.objects().into_iter().map(|o| o.key()).collect::<Vec<_>>());

Again, everything works as expected in production.

Steps To Reproduce

No response

buchgr avatar Aug 22 '23 20:08 buchgr