Skip to content

[workflows-shared] Report local batch deletion failures - #15158

Open
ryux1 wants to merge 1 commit into
cloudflare:mainfrom
ryux1:fix/workflows-delete-batch-results
Open

[workflows-shared] Report local batch deletion failures#15158
ryux1 wants to merge 1 commit into
cloudflare:mainfrom
ryux1:fix/workflows-delete-batch-results

Conversation

@ryux1

@ryux1 ryux1 commented Aug 13, 2026

Copy link
Copy Markdown

Fixes #15138.
Related to #15139.

Local Workflow.deleteBatch() treated every requested ID as deleted, including unknown instances and failed deletions. Its post-abort status result was discarded, and its Promise.allSettled() rejection path could not be reached.

This change aligns the local binding with the workerd API contract:

  • Check each unique instance before deletion and return the production 10400 not-found payload for unknown IDs.
  • Reacquire a fresh Durable Object stub after aborting and report an internal error if the instance still exists.
  • Preserve one result per input position, including duplicate successful IDs, while performing deletion work only once per unique ID.
  • Treat missing bookkeeping entries as internal errors instead of successes.

Regression coverage includes successful, missing, duplicate, failed, empty, and over-limit batches.

Validation:

  • pnpm --filter @cloudflare/workflows-shared test:ci (156 tests)
  • pnpm --filter @cloudflare/workflows-shared check:type
  • pnpm check (39 build tasks and 203 repository check tasks)

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: this aligns local behavior with the existing production API contract.

Note

This is a contribution from an AI agent: OpenAI Codex, GPT-5.

@ryux1
ryux1 requested a review from workers-devprod as a code owner August 13, 2026 00:05
@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8bfc01e

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

This PR includes changesets to release 1 package
Name Type
@cloudflare/workflows-shared 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

@workers-devprod
workers-devprod requested review from a team and NuroDev and removed request for a team August 13, 2026 00:06
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/workflows
  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/calm-workflows-delete.md: [@cloudflare/wrangler]
  • packages/workflows-shared/src/binding.ts: [@cloudflare/workflows @cloudflare/wrangler]
  • packages/workflows-shared/tests/binding.test.ts: [@cloudflare/workflows @cloudflare/wrangler]

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[workflows] Local deleteBatch() always reports success, so failures are invisible

2 participants