Conversation
🦋 Changeset detectedLatest commit: da9d9b8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
10 Skipped Deployments
|
|
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Bug: Payment Button Fails to Disable During Processing
The "Open Pay Modal" button is no longer disabled or shows a loading state during payment processing. This allows users to trigger multiple concurrent pay() calls, creating a race condition where new calls reset the PayController state, causing earlier payment attempts to hang or fail. Previously, the button was disabled using isPending state and displayed a spinner.
apps/laboratory/src/components/AppKitPay.tsx#L501-L504
appkit/apps/laboratory/src/components/AppKitPay.tsx
Lines 501 to 504 in da9d9b8
Bug: Async Function Call Without Await
The async handlePayment() function is called without await within the ConnectionController.subscribeKey and AccountController.subscribeKey subscription handlers. This change from the original implementation, which correctly used await, can lead to unhandled promise rejections if handlePayment() throws an error.
packages/pay/src/controllers/PayController.ts#L300-L321
appkit/packages/pay/src/controllers/PayController.ts
Lines 300 to 321 in da9d9b8
Bug: Payment API Error Handling Inconsistency
The pay function exhibits inconsistent error handling: it rejects the promise on timeout, but resolves with { success: false } for all other payment failures. To maintain API consistency, timeouts should also resolve with { success: false, error: 'Payment timeout' }.
packages/pay/src/client.ts#L38-L46
appkit/packages/pay/src/client.ts
Lines 38 to 46 in da9d9b8
Bug: Unhandled Promise Rejections in Payment Handling
The handleOpenPay function lacks a try-catch block around the await pay call. Although pay returns a result object for most outcomes, it can still reject its promise (e.g., due to timeouts, initialization failures, or other critical errors). This omission results in unhandled promise rejections, leading to application crashes or silent failures without appropriate error messages being displayed to the user.
apps/laboratory/src/components/AppKitPay.tsx#L183-L204
appkit/apps/laboratory/src/components/AppKitPay.tsx
Lines 183 to 204 in da9d9b8
Was this report helpful? Give feedback by reacting with 👍 or 👎
Description
Changed the pay method to handle the success/error subscription internally and export single
paymethod that will resolve once the payment is completed.Before:
After:
Tehnical
isSettledis added because we react on multiple different state subscriptions. In order to avoid race conditions, we introduce additional variable in case multiple subscriptions trigger the handlerAdditionally this handles
Type of change
Associated Issues
For Linear issues: Closes APKT-xxx
For GH issues: closes #...
Showcase (Optional)
If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.
Checklist