fix(r2): local bulk delete reports absent keys as successful
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
- Domain
- backend-api-design, cli
Research direction
Start by comparing the cf r2 objects bulk-delete help output with the local bulk-delete behavior described in the reproduction. The issue points to Miniflare’s packages/miniflare/src/workers/local-explorer/resources/r2.ts implementation; read the linked section and trace how missing keys are handled. Verify the mixed-key case reports one failure while deleting the existing key, and that an existing key alone still succeeds.
Written by the indexing model from the issue text.
Description
Summary
cf r2 objects bulk-delete --local reports an absent key in its success output and exits 0. This makes a mixed existing-and-missing deletion look fully successful in a local script, although the command help specifies a failure entry for each missing key.
Steps to reproduce
Use the CLI described under Runtime or environment. Run these commands in a new temporary directory. The created first key is disposable, and absent is never written.
cf r2 objects put first --body sample --bucket-name sample-bucket --local --persist-to state
cf r2 objects bulk-delete --body '["first","absent"]' --force --bucket-name sample-bucket --local --persist-to state
cf r2 objects list --bucket-name sample-bucket --local --persist-to state
Expected behavior
The operation deletes first and reports a partial failure with one error entry, as described by CLI help. If the simulator deliberately supports an idempotent operation instead, local mode states that missing keys will be reported as successful before callers rely on the result.
Actual behavior
Both CLI builds exited 0. Stdout was [{"key":"first"},{"key":"absent"}] with no missing-key report. Listing after deletion confirmed first had been removed.
Runtime or environment
- macOS 27.2 arm64, Node.js 26.13.1, npm 12.2.2.
- Published
cf1.0.0-rc.1 and the currentmainCI package, both with bundled Miniflare 5.20261117.0-beta. The CLI README at that revision includes array-body bulk deletion among supported local operations. - A direct Local Explorer request on Miniflare 5.20261118.0-beta returned status 200 with
success: trueand both keys while removingfirst.
Evidence
- Expected source:
cf r2 objects bulk-delete --helpdescribessuccess: false,result: nulland one error entry for each failed key, including a missing key. - Failure source: The mixed-key request above exits 0 and lists both keys without an error. The Local Explorer bulk-delete implementation acknowledges the supplied keys after deletion. The issue is the resulting difference from the CLI's advertised behavior.
- Evidence provenance: observed
- Local verification: reproduced
- Reproduction completeness: complete
Restoration check
Repeat the mixed-key case. first disappears from the bucket and the command surfaces one failure for the mixed-key request. If idempotent deletion is the supported local behavior, the CLI explains the local success semantics in its help and runtime output. A bulk delete containing only an existing key still succeeds.
References
- https://github.com/cloudflare/cf/issues/209 — That report concerns slash-containing keys whose objects remain after remote deletion. This local case uses plain keys and the existing object is deleted.
Triage assessment
- Impact level: P2
- Assessment status: supported
- Impact basis: Local tests can report a clean cleanup pass for a key that never existed and conceal how their script handles the documented partial-failure response.
- Workaround status: unverified
- Workaround basis: No local
cfbulk-delete option was found that reports missing keys distinctly.
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 1.7k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 282
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/workers-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
cloudflare/workers-sdk#17215 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
cloudflare/workers-sdk#17189 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/workers-sdk#17187 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
cloudflare/workers-sdk#17175 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
cloudflare/workers-sdk#17174 ·
Maintainers usually reply within 1 day
All issues in cloudflare/workers-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
earendil-works/pi#12615 ·
Maintainers usually reply within 1 day
-
My Caps shows "Shared" on private Caps that were never sharedPossibly taken @AksharP5 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CapSoftware/Cap#4569 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
OHDSI/Data2Evidence#3749 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Flagsmith/flagsmith-nodejs-client#332 ·
Maintainers usually reply within 2 days