Commit e8401ae
authored
fix: max mUSD conversion displays wrong value (#29175)
## **Description**
Fixes the max mUSD conversion showing an inflated receive amount. Relay
previously charged a fee and reimbursed it on the destination side; they
have since stopped charging the fee, so our compensating adjustment now
over-reports the received value.
Bumps `@metamask/transaction-pay-controller` from `^19.1.1` to
`^19.2.1`, which stops double-counting the subsidised fee in Relay quote
target amounts, and patches the installed package to rename the Relay
gasless feature flag from `executeEnabled` to `gaslessEnabled` so older,
known-broken versions cannot be re-enabled by the flag (which predates
per-version gating).
## **Changelog**
CHANGELOG entry: Fixed max mUSD conversion displaying an inflated
receive amount.
## **Related issues**
Fixes: #29173
## **Manual testing steps**
```gherkin
Feature: Max mUSD conversion displays correct value
Scenario: user converts max USDC to mUSD
Given a 7.74 build with this patch installed
And the user holds some USDC
When the user taps max on the mUSD conversion screen
Then the displayed mUSD receive amount matches the USDC balance (no inflation)
```
## **Screenshots/Recordings**
### **Before**
### **After**
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Updates core transaction/pay controller dependencies and applies a
patch that changes which remote feature flag enables Relay gasless
execution, which could affect pay/quote flows if flag configuration or
dependency behavior differs from expectations.
>
> **Overview**
> Fixes an inflated “max” conversion receive amount by bumping
`@metamask/transaction-pay-controller` to `^19.2.1` (and aligning
related controller versions via `yarn.lock`/resolutions).
>
> Adds a patch to `@metamask/transaction-pay-controller` that switches
the Relay enablement check from
`confirmations_pay.payStrategies.relay.executeEnabled` to
`...relay.gaslessEnabled`, preventing older broken builds from being
re-enabled by the previous flag name.
>
> Separately removes the locally-defined `MANTLE` entry from
`NETWORK_CHAIN_ID` in `customNetworks.tsx` (relying on `CHAIN_IDS` for
it instead).
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
67e50b9. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent c249da7 commit e8401ae
4 files changed
Lines changed: 175 additions & 92 deletions
File tree
- app/util/networks
- patches
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
395 | 394 | | |
396 | 395 | | |
397 | 396 | | |
| |||
438 | 437 | | |
439 | 438 | | |
440 | 439 | | |
441 | | - | |
442 | 440 | | |
443 | 441 | | |
444 | 442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
202 | 204 | | |
203 | 205 | | |
204 | 206 | | |
| |||
325 | 327 | | |
326 | 328 | | |
327 | 329 | | |
328 | | - | |
| 330 | + | |
329 | 331 | | |
330 | 332 | | |
331 | 333 | | |
| |||
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
0 commit comments