You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(hyperdrive): namespace services by worker and seed every dev entry point
Addresses two review comments.
Services, proxies and TCP bridges were keyed on the binding name alone, so
in a multi-worker setup two workers binding Hyperdrive under the same name
(`DB` is the obvious case) collided on one service and one bridge. They are
now keyed by worker index as well, matching how the cache plugin and the
core plugin's custom services namespace theirs.
Edge credentials also now reach the entry points that could not fetch them
themselves: `unstable_getMiniflareWorkerOptions()` accepts them as an
option, and the Vite plugin and vitest-pool-workers — which already await
`maybeStartOrUpdateRemoteProxySession()` — pass through what the session
prepared. The warning for a binding left without credentials no longer
claims those environments are unsupported.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
Copy file name to clipboardExpand all lines: packages/wrangler/src/dev/miniflare/index.ts
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -367,14 +367,15 @@ function hyperdriveEntry(
367
367
hyperdrive.binding
368
368
);
369
369
if(seededConnectionString===undefined){
370
-
// Seeding is what makes a database client authenticate through the edge
371
-
// proxy; without it miniflare falls back to placeholder credentials (and
372
-
// a `mysql` scheme even for Postgres) and the login is rejected. Warn
373
-
// rather than throw, so dev paths that cannot seed — the entry points
374
-
// below are synchronous — stay usable and fail visibly instead of
375
-
// silently.
370
+
// The edge session's credentials are what let a database client
371
+
// authenticate through the proxy; without them miniflare falls back to
372
+
// placeholder credentials (and a `mysql` scheme even for Postgres) and
373
+
// the login is rejected. They are prepared by
374
+
// `maybeStartOrUpdateRemoteProxySession`, so reaching this means the
375
+
// caller did not pass them on. Warn rather than throw so the session
376
+
// stays usable and fails visibly instead of silently.
376
377
logger.once.warn(
377
-
`The Hyperdrive binding "${hyperdrive.binding}" is configured with "remote": true, but its edge credentials could not be seeded in this context, so connections through it will likely fail to authenticate. Remote Hyperdrive bindings are currently supported in \`wrangler dev\` and \`getPlatformProxy()\`.`
378
+
`The Hyperdrive binding "${hyperdrive.binding}" is configured with "remote": true, but no edge credentials were provided for it, so connections through it will likely fail to authenticate.`
0 commit comments