-
Notifications
You must be signed in to change notification settings - Fork 5.5k
feat: subscription-state-after-exiting-modal #39695
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
feat: subscription-state-after-exiting-modal #39695
Conversation
✨ Files requiring CODEOWNER review ✨🔐 @MetaMask/web3auth (1 files, +29 -2)
|
Builds ready [b7d7db4]
UI Startup Metrics (1265 ± 111 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Builds ready [d18ff24]
UI Startup Metrics (1362 ± 112 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [f11ccdd]
UI Startup Metrics (1356 ± 129 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [dc1fc54]
UI Startup Metrics (1413 ± 108 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Description
This PR improves the Shield subscription payment flow by clearing the cached payment method after payment fail/cancel
Problem:
Additionally, when clearing the cache, the UI would auto-switch the payment method unexpectedly due to a useEffect dependency on lastUsedPaymentDetails.
Solution:
Changelog
CHANGELOG entry: reset shield default payment method to most suitable one (crypto) if available after payment flow cancel
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Screen.Recording.2026-02-02.at.17.01.00.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches Shield subscription payment flows (card and crypto) and the UI default-payment selection logic, so regressions could affect the checkout retry experience. Changes are small and covered by an updated unit test around timeout/failure behavior.
Overview
Improves Shield subscription retry behavior after failed/cancelled payments. The subscription background service now calls
SubscriptionController:clearLastSelectedPaymentMethodon card checkout errors (including polling timeout/cancel) and on crypto approval failures, after tracking failure metrics.Updates the SubscriptionService messenger/type allowlists to include the new controller action and extends tests to assert the cache clear happens.
Prevents unexpected UI switching.
ShieldPlanadds auseRefguard so the initial auto-selection (crypto vs card) only runs once, and clicking Continue now sets this flag before starting the subscription flow.Written by Cursor Bugbot for commit dc1fc54. This will update automatically on new commits. Configure here.