[miniflare] Native dev registry review feedback#13569
Conversation
…on' in proxy errors When a registry entry exists but lacks debugPortAddress (written by an older wrangler), the proxy now returns a specific message asking the user to update all Wrangler instances, instead of the generic 'not found' message.
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR.
This PR improves proxy error messages to distinguish "worker not running" from "incompatible wrangler version", and switches explorer cross-instance aggregation from HTTP loopback to debug port RPC.
I found two issues with the test updates:
-
Wrong service name in test assertion (high): The test at
fixtures/dev-registry/tests/dev-registry.test.ts:937expects an error message about"service-worker", but the bindingWORKER_ENTRYPOINT_WITH_ASSETSmaps to service"worker-entrypoint-with-assets"(seewrangler.worker-entrypoint.jsoncline 20-22). The proxy usesthis.ctx.props.servicein the error message, which would be"worker-entrypoint-with-assets". Additionally, since"worker-entrypoint-with-assets"has no registry entry at all at that point (only"worker-entrypoint"is registered bygetPlatformProxy),hasRegistryEntryreturnsfalseand the message should be the "not found" variant, not "not compatible". See inline suggestion. -
Missing test update for stale registry (medium): The existing "gracefully handles a stale registry entry" test at
fixtures/dev-registry/tests/dev-registry.test.ts:1228-1229expectsWorker "service-worker" not found. Make sure it is running locally., but now that an old-format entry IS in the registry Map (written at line 1206),hasRegistryEntry("service-worker")returnstrue, soworkerNotFoundMessageshould return the "not compatible" message instead. This line wasn't changed in the PR but should be updated to:`Worker "service-worker" is not compatible with this version of the dev server. Please update all Worker instances to the same version.` -
Stale JSDoc on
fetchFromPeer(low): The@param peerUrldoc ataggregation.ts:56still says "Base URL of the peer instance (e.g., http://127.0.0.1:8788)" but the parameter now receives a debug port address like"127.0.0.1:12345". See inline suggestion.
|
The review has been posted successfully. Here's a summary of what I found:
|
|
Codeowners approval required for this PR:
Show detailed file reviewers |
Replace HTTP loopback aggregation with debug port RPC. Remove loopbackAddress from WorkerDefinition since the explorer now connects to peers via the debug port directly. Add DEV_REGISTRY_DEBUG_PORT binding to the explorer worker.
3a5c508 to
ed45595
Compare
…ssage The test was passing by accident — vi.waitFor succeeded before the file watcher picked up the old-format entry, so it matched the generic 'not found' message. Now waits specifically for the incompatible version message to verify the detection works end-to-end.
…egation Entries from older wrangler versions lack debugPortAddress. Filter them out in getPeerDebugPortAddresses() to avoid passing undefined to connect(). Also rename peerUrl parameter to peerDebugPortAddress to match the new semantics.
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Follow-up to #12600.
Summary
debugPortAddress(old format), the proxy now returns a specific message instead of the generic "not found"loopbackAddressfromWorkerDefinition