fix: coinbase popup polling fallback, retry reset, and animated alerts#2453
Merged
fix: coinbase popup polling fallback, retry reset, and animated alerts#2453
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
2b45e34 to
f162258
Compare
- Add 5s fallback poll that starts immediately when popup opens, so the keychain can detect payment completion even if BroadcastChannel signal is lost. Upgrades to 1s fast poll on polling_success from popup. - Set terminalReachedRef on polling_success to prevent popup-closed race condition (stuck 'Complete in Popup' after successful payment). - Clear failed/error state on retry events (pending_payment_auth, payment_authorized, apple_pay_button_pressed) so popup shows 'Payment Processing' instead of lingering 'Payment Cancelled'. - Animate status bar alerts with slide-down transition instead of abruptly shifting the iframe.
f162258 to
cfbcb0a
Compare
Contributor
|
Claude finished @broody's task —— View job Documentation Analysis
ResultNo documentation updates needed. This PR contains internal reliability improvements and UX polish for the Coinbase payment popup flow:
Why no docs changes:
These improvements make the payment experience more reliable for end users, but the developer-facing integration remains unchanged. |
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
Three fixes for the Coinbase payment popup flow, plus a UX polish.
1. Fallback polling prevents stuck 'Complete in Popup'
Problem: If the BroadcastChannel signal from the popup was lost (e.g. browser restrictions, timing), the keychain would stay stuck on 'Complete in Popup' forever.
Fix: Start a slow 5s fallback poll as soon as the popup opens. This detects payment completion on the backend even without the popup signal. When
polling_successarrives from the popup, the poll upgrades to 1s fast poll with a 15s timeout (same as before).2. Terminal ref set on polling_success (race condition fix)
Problem: After successful payment, the popup closes after 1.5s. The popup-close watcher would detect this and set
popupClosed=truebefore the backend confirmation poll completed, causing the UI to show 'Payment Window Closed' instead of progressing.Fix: Set
terminalReachedRef.current = trueimmediately onpolling_success, not just when the backend confirmsCompleted.3. Retry clears cancelled state in popup
Problem: After cancelling a payment and retrying within the same popup, the 'Payment Cancelled' alert stayed visible because
pending_payment_auth,payment_authorized, andapple_pay_button_pressedevents only setcommitted=truewithout clearingfailedanderror.Fix: Clear
failedanderroron all active-payment events.4. Animated status bar alerts
Problem: Status bar alerts popped in abruptly and shifted the Coinbase iframe down.
Fix: Status bar now overlays the top of the iframe with a
translate-yslide-down animation (300ms ease-out). The iframe always fills the full screen.Polling Strategy