Skip to content

fix(commerce-elastic-path): a saved shipping address is a quoted address - #597

Merged
field123 merged 3 commits into
masterfrom
claude/issues-592-593-cdcb4c
Sep 28, 2026
Merged

field123 merged 3 commits into
masterfrom
claude/issues-592-593-cdcb4c

Conversation

@field123

@field123 field123 commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

The checkout-session update cleared the shipping rates when the address changed and left fetching new ones to a second request. When that request was missing, the session held an address and no rates, nothing could select a rate, and /pay failed closed.

  • The update now runs the shippingRateResolver on the updated session and saves the address and the new rates in one write. The check that clears the rates is the check that requotes. An equivalent address keeps the rates and the selected rate.
  • A resolver failure does not fail the update: the address is saved with an empty rate list and the error is logged.
  • The managed form no longer calls the requote after the update, so the resolver runs once per address change.
  • The /shipping route, its handler and the calculateShipping ref action are unchanged, and their docs now describe on-demand requoting. The README gains a checkout-session route table.

Two related fixes found while verifying this:

  • The logger now writes warnings and errors on the server. It read its level only from localStorage, so every server-side message was dropped, errors included. EP_DEBUG in the server environment sets the level; EP_DEBUG=silent restores the old behaviour.
  • The example app mints its admin token with EP_CLIENT_ID, the client its secret belongs to, instead of the Plasmic project's client ID. With the two different, the client_credentials grant was rejected, so picking a rate never wrote the shipping line and /pay could not authenticate.

No registered surface is added or removed, and there is no version bump.

Closes #592
Closes #593
Closes #584

…ipping address changes

The update cleared the rates on an address change and left fetching new ones
to a second request. A checkout without one held an address and no rates, so
nothing could select a rate and /pay failed closed.

The update now runs the shipping rate resolver on the updated session and
persists the address and the rates in one write. The condition that clears the
rates is the condition that requotes. A resolver failure is logged and leaves
the address saved with an empty list. The managed form stops calling the
requote after the update, so the resolver runs once per address change. The
standalone requote is unchanged and documented as on-demand.

Closes #592
Closes #593
Closes #584
The logger read its level only from localStorage, so on the server every
message was dropped, errors included. A shipping-line write that could not
authenticate, or an order that failed to reconcile, left no trace.

With no localStorage the logger now reads EP_DEBUG from the environment, with
the same values, and defaults to warn. The browser default is unchanged.
…wn client

The checkout context paired EP_CLIENT_SECRET with the Plasmic project's client
ID. When the two differ the client_credentials grant is rejected, so picking a
rate never wrote the shipping line and /pay could not authenticate.
@field123
field123 merged commit 3b45a8e into master Sep 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant