Repository navigation
[remote-bindings] Fail RPC binding requests on network errors instead of hanging - #16949
Draft
edmundhung wants to merge 1 commit into
Draft
edmundhung wants to merge 1 commit into
edmundhung wants to merge 1 commit into
Conversation
… of hanging The ProxyWorker treated a failed fetch as stale (from a reloaded preview) whenever the request's full URL differed from the preview's bare origin. RPC bindings connect to `/?MF-Binding=<name>`, so every network failure looked like a reload, and the request waited in the retry queue for a `play` that never came instead of failing with the error. Comparing origins, as Wrangler does, doesn't work here: remote previews keep the same `<worker>.<subdomain>.workers.dev` host across reloads and only change the preview token. Compare the proxyData the request was sent with instead, since every `play` sets a new object.
🦋 Changeset detectedLatest commit: 737a141 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
Contributor
|
P1: If the replacement |
Contributor
|
I'm Bonk, and I've done a quick review of your PR. Fixes remote RPC network errors being mistaken for preview reloads.
|
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/runtime-types
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
2 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The remote-bindings proxy decides whether a failed request came from a reloaded preview by comparing the request's full URL with the preview's bare origin. RPC bindings connect to
/?MF-Binding=<name>, so every network failure (offline, DNS, TLS) looked like a reload, and the request sat in the retry queue with no error until the next reload, if one ever came.It now compares the
proxyDatathe request was sent with, since everyplaysets a new object. Wrangler's origin check (#14593) wouldn't work here: remote previews keep the same<worker>.<subdomain>.workers.devhost across reloads and only change the preview token.