[miniflare]: Fix local scheduled handler returning exception when assets is enabled#14177
Conversation
🦋 Changeset detectedLatest commit: bed00e4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
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 |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
There was a problem hiding this comment.
Is a simpler fix for this just to add the following to packages/miniflare/src/workers/assets/rpc-proxy.worker.ts
scheduled(controller, env, ctx) {
return this.env.USER_WORKER.scheduled(controller, env, ctx);
}
Edit: It was not quite as easy as this but I think this is the right direction. Pushed a commit
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
fdfa954 to
eb52f34
Compare
|
I hope you don't mind but I have pushed a commit that is an alternative way to fix this. |
|
What I changed Instead of bypassing the assets RPC proxy with a new SERVICE_RAW_USER_FALLBACK binding, I made the proxy itself forward scheduled events correctly. Two small pieces:
This let me revert the SERVICE_RAW_USER_FALLBACK binding, the new CoreBindings entry, and the entry-worker change — the dispatch flow stays unified through the proxy, which felt closer to the existing fetch/tail pattern in rpc-proxy.worker.ts. All the tests you added still pass with this approach. |
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
@cloudflare/wrangler-bundler
commit: |
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Thanks for pushing the update. I wasn’t aware of the |
scheduled handler returning exception when assets is enabled
Fixes #9882
bypass asset rpc worker for scheduled handler
Relate: #13704
A picture of a cute animal (not mandatory, but encouraged)