Skip to content

feat(miniflare): add json output to /cdn-cgi/handler/scheduled#14079

Merged
edmundhung merged 2 commits into
mainfrom
edmundhung/fix-scheduled-result
May 28, 2026
Merged

feat(miniflare): add json output to /cdn-cgi/handler/scheduled#14079
edmundhung merged 2 commits into
mainfrom
edmundhung/fix-scheduled-result

Conversation

@edmundhung

@edmundhung edmundhung commented May 28, 2026

Copy link
Copy Markdown
Member

Fixes n/a.

There was no way to know if controller.noRetry() is called from the endpoint. This adds a ?format=json query so miniflare can return the full result, while keeping the default unchanged for backward compatibility.


  • 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: bugfix

A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot

changeset-bot Bot commented May 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 30b435a

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

This PR includes changesets to release 5 packages
Name Type
miniflare Minor
@cloudflare/pages-shared Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch
wrangler 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

@ask-bonk

ask-bonk Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

I've reviewed all three changed files thoroughly. The changes are minimal, well-structured, and correct:

  1. scheduled.ts: Adds a format query parameter check. When format=json, returns Response.json(result) with the same status logic. Otherwise falls through to the existing text response. Backward compatible.

  2. index.spec.ts: The test is properly extended -- adds controller.noRetry() to the scheduled handler and adds a new assertion for the ?format=json response, verifying both the JSON structure and that noRetry is reflected.

  3. Changeset: Properly scoped to miniflare as a patch, with a clear description.

No logic bugs, no security issues, no backward compatibility concerns. The result object from service.scheduled() is passed directly to Response.json(), which correctly serializes it.

LGTM

github run

@edmundhung edmundhung changed the title feat(miniflare): add json output to /cdn-cgi/handler/scheduled fix(miniflare): add json output to /cdn-cgi/handler/scheduled May 28, 2026
@edmundhung edmundhung marked this pull request as ready for review May 28, 2026 11:00
@workers-devprod workers-devprod requested review from a team and penalosa and removed request for a team May 28, 2026 11:01
@workers-devprod

workers-devprod commented May 28, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@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 found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment thread .changeset/stale-shoes-learn.md Outdated
@pkg-pr-new

pkg-pr-new Bot commented May 28, 2026

Copy link
Copy Markdown
create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14079

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14079

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14079

miniflare

npm i https://pkg.pr.new/miniflare@14079

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14079

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14079

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14079

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14079

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14079

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14079

wrangler

npm i https://pkg.pr.new/wrangler@14079

commit: 30b435a

@edmundhung edmundhung changed the title fix(miniflare): add json output to /cdn-cgi/handler/scheduled feat(miniflare): add json output to /cdn-cgi/handler/scheduled May 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Issues found

  1. .changeset/bump-rosie-skills.md — Lacks user impact explanation.
    • The changeset states what is changing (bumping rosie-skills from 0.6.3 to 0.7.6), but does not explain why the bump is needed or what user-facing impact it has.
    • Per .changeset/README.md, "update dependency" is listed as a bad example because it fails to answer "Which one? Why? Any user impact?" Naming the dependency satisfies the first question, but the remaining two are unanswered.
    • Suggestion: Add a sentence or two explaining what changes or fixes the new version of rosie-skills brings to Wrangler users.

@workers-devprod workers-devprod 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.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk May 28, 2026
@edmundhung edmundhung merged commit 972d13d into main May 28, 2026
60 of 61 checks passed
@edmundhung edmundhung deleted the edmundhung/fix-scheduled-result branch May 28, 2026 11:29
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants