fix: tighten Coinbase popup message handling#2450
Conversation
Capture error fields in the popup parser fallback so Coinbase error messages are displayed to users, and treat cancel events as failed terminal states to avoid showing a stale processing indicator.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Replace fallback regex field extraction with a linear string scanner so Coinbase popup error parsing remains robust without risky regular expressions.
Apply strict Coinbase message parsing with explicit event-state transitions and add popup tests for stringified load, error, progress, and cancel postMessage events.
|
Claude finished @broody's task —— View job Documentation AnalysisAnalyzing PR #2450 to determine if documentation updates are needed... Tasks:
Analysis CompleteChanges in PR #2450:
Documentation Impact: None required This PR is an internal bug fix that does not require documentation updates for the following reasons:
Per documentation rules:
The existing Coinbase Onramp documentation (
Conclusion: No documentation updates needed for this PR. |
Summary
postMessageparsing to be strict JSON/object handling (remove raw-string field extraction fallback) and keep safe nested payload unwrappingload_pending,load_success,load_error,commit_success,commit_error,cancel,polling_start,polling_success,polling_error) so processing/success/error states are consistentcancelis treated as a terminal failure state and no longer leaves the popup in a stale "Payment processing..." stateload_success,polling_errorwith message surface,apple_pay_button_pressed,pending_payment_auth, andcancelTest plan
pnpm formatpnpm --filter @cartridge/keychain test:ci -- src/components/coinbase-popup.test.tsxonramp_api.canceland verify processing clears + cancellation message appearsonramp_api.polling_errorand verify Coinbase error text is surfacedonramp_api.polling_successand closes popup