fix: initialize only the charge payment method - #30
Merged
irvinebroque merged 1 commit intoJul 23, 2026
Conversation
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.
Summary
402 Payment Requiredresponses on protected routes withmppx@0.4.11Bug
The stock proxy on
mainreturns500 Internal Server Errorfor requests that enter its payment middleware.tempo()creates bothtempo.charge()andtempo.session(). Inmppx@0.4.11,tempo.session()requires a signing account when it is constructed. The proxy suppliesPAY_TOas a recipient address because it only handles one-time charges, so the unused session constructor throws fromMppx.create()before the proxy can check a cookie or return its charge challenge:The proxy has always passed
mppx.chargeto its Hono payment middleware. It does not expose a session handler, channel store, usage-metering configuration, or server signing account. Selectingtempo.charge()therefore removes only the unused constructor that causes the failure; it does not remove a supported proxy payment flow.Behavior
mainGET /__mpp/health200 OK200 OKGET /__mpp/protected500 Internal Server Error402 Payment Requiredwithmethod="tempo"andintent="charge"The public health endpoint does not exercise payment initialization, so it can remain green while protected routes are broken.
Reproduction
I reproduced this from current
mainat59ce12a72bad3cd7f331989517a2904d64e0b5d1:npm ci cp .dev.vars.example .dev.vars # Set JWT_SECRET and MPP_SECRET_KEY to non-empty local test values. npm run devIn another terminal:
Running the same smoke test on this branch returns:
Impact
Stock-template builds using the repository lockfile with
mppx@0.4.11are affected. Previously deployed Worker versions that bundled an older workingmppxrelease do not change until they are rebuilt or redeployed.Unprotected routes and requests bypassed by a Bot Management exception do not enter this constructor and are unaffected.
Validation
npm testnpm run lint200, protected route500with the session-account error200, unpaid protected route402with a charge challenge