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.
Preview/auth payment test #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Preview/auth payment test #1
Changes from all commits
77b52b2cef2829dbc1933c442617abfd68e9a116e7acb60f53ba6a82e1c7a200e86d8e666a73156a13f987b3943978d678File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a timeout to the outbound Minepi
fetchinapps/axiomid/src/app/api/pi/payment/incomplete/route.ts.The handler performs a blocking external call to
https://api.minepi.com/v2/payments/${paymentId}without anyAbortSignal/timeout, so upstream slowness can tie up request handling and cascade latency.🔧 Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Pi Network server-side flow for an incomplete payment requires calling
/v2/payments/{id}/approveand then/v2/payments/{id}/complete(with the on-chaintxid). This handler only performs a GET to fetch the payment status and returns the result — it never calls approve or complete. Any payment surfaced by the SDK as incomplete duringpi.connect()will remain permanently stuck in the pending state, as neither the app nor the SDK will make further attempts to resolve it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
window.postMessageis patched unconditionally for every visitorSandboxProviderwraps the entire app and always callsinitSandboxCompatibility(), which replaceswindow.postMessagewith a version that forwards every outgoing message towindow.parentwith"*"astargetOriginwhenever the app is inside an iframe (seepi-sandbox.tslines 4–10). This runs for all users regardless of whether sandbox mode is active, broadcasting any postMessage sent in an iframe context — including auth tokens or other app state — to an arbitrary parent origin. Consider gating this behind the same sandbox flag used elsewhere.Uh oh!
There was an error while loading. Please reload this page.