cloudflare / cloudflare/workers-rs

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

Open
#377 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
3.7k
Forks
429
Avg merge
20h 28m
Merged PRs (30d)
7

Description

### 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.

```toml
[[r2_buckets]]
binding = "FOO"
bucket_name = "foo"
preview_bucket_name = "foo-test"
```

```rust
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`.

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

Again, everything works as expected in production.

### Steps To Reproduce

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.