fix: filter fiat payment methods by delay and use enabledTransactionTypes#29854
Conversation
enabledTransactionTypes
ca6f596 to
098bc07
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d27fbf2. Configure here.
| maxDelayMinutesForPaymentMethods: number, | ||
| ): boolean { | ||
| return !pm.delay || pm.delay[1] <= maxDelayMinutesForPaymentMethods; | ||
| } |
There was a problem hiding this comment.
Missing guard for malformed delay arrays in filter
Low Severity
isWithinDelayLimit checks !pm.delay which doesn't guard against empty or single-element arrays. When delay is [] or [5], pm.delay[1] is undefined, and undefined <= maxDelay evaluates to false in JavaScript, silently filtering out the payment method. The existing codebase in PaymentMethodListItem.tsx defensively checks Array.isArray(paymentMethod.delay) && paymentMethod.delay.length >= 2 before accessing delay[1], suggesting malformed delay data is possible at runtime.
Reviewed by Cursor Bugbot for commit d27fbf2. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Key impact chain:
The change is scoped to the pay/fiat payment feature within confirmations. The default value changes from Performance Test Selection: |
|





Description
Replace the boolean
enabledfiat feature flag with a granularenabledTransactionTypesarray. The hook now useshasTransactionTypeto check whether the current transaction (including nested transactions) matches any enabled type, instead of a simple on/off toggle.Additionally, payment methods whose upper-bound delay exceeds 10 minutes are now filtered out so only fast payment options are surfaced in the Pay-With modal.
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
Pre-merge reviewer checklist
Note
Medium Risk
Changes remote-flag shape and gating logic for showing fiat Pay-With options, which can unintentionally hide or expose payment methods for certain confirmation flows if flags are misconfigured. Filtering by delay also alters user-visible payment availability.
Overview
Updates the Pay-With fiat feature flag from a boolean
enabledto a structured config withenabledTransactionTypesandmaxDelayMinutesForPaymentMethods, including new defaults inselectMetaMaskPayFiatFlags.useFiatPaymentHighlightedActionsnow only returns highlighted fiat payment actions when the current (or nested) transaction matches an enabled type viahasTransactionType, and it filters out payment methods whose upper-bounddelayexceeds the configured maximum. Tests are updated/expanded to cover the new flag shape, transaction-type gating, and delay-based filtering.Reviewed by Cursor Bugbot for commit 1bbbfeb. Bugbot is set up for automated code reviews on this repo. Configure here.