fix(ep-commerce): say which proxy function is missing, and guard the drift - #444
Merged
Conversation
3 tasks
…drift
An unknown proxy function 404s with `{error: "unknown_fn"}`, and
`readProxyError` copies that token straight into `Error.message` — so a
shopper sees `unknown_fn` and the console logs `placeOrder failed
{error: "unknown_fn"}`. Nothing says the function is absent from the
route's dispatch table, which is the one fact needed to act on it.
The 404 body now carries a `message` naming the function and the reason
(`readProxyError` prefers `message`, so the client needs no change), a
`code` for callers branching on `epProxyErrorCode`, and a server-side
log line for anyone reading network or server logs.
The parity test asserts every `callEpProxy` call site has a `FN_DISPATCH`
entry. `applyCartAdjustment` and `placeOrder` sit in a documented
allowlist — whether a public proxy route may move money is the open
question in #371 — and a companion assertion fails if an allowlisted name
becomes dispatchable or stops being called, so the list cannot go stale.
Fixes #386
field123
force-pushed
the
fix/ep-386-unknown-fn
branch
from
August 20, 2026 10:27
0981727 to
02913ac
Compare
field123
changed the base branch from
fix/ep-commerce-extensions-path
to
master
August 20, 2026 10:27
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.
An unknown proxy function 404s with
{error: "unknown_fn"}, andreadProxyErrorcopies that token straight intoError.message— so a shopper seesunknown_fnand the console logsplaceOrder failed {error: "unknown_fn"}. Nothing says the function is absent from the route's dispatch table, which is the one fact needed to act on it.The 404 body now carries a
messagenaming the function and the reason (readProxyErrorprefersmessage, so the client needs no change), acodefor callers branching onepProxyErrorCode, and a server-side log line for anyone reading network or server logs.A parity test asserts every
callEpProxycall site has aFN_DISPATCHentry.applyCartAdjustmentandplaceOrdersit in a documented allowlist — whether a public proxy route may move money is the open question in #371 — and a companion assertion fails if an allowlisted name becomes dispatchable or stops being called, so the list cannot go stale.One note:
EPCheckoutFormProvider.tsx:455putserr.messagestraight intosetError, so in the unwired state a shopper now sees the technical sentence rather thanunknown_fn. Left deliberately — the designer in the canvas is the only person who can act on it. Branching onepProxyErrorCode(err) === "unknown_fn"for a friendlier string is a possible follow-up.Fixes #386