Skip to content

Conversation

runway-github[bot]
Copy link
Contributor

@runway-github runway-github bot commented Oct 17, 2025

Description

Explicitly wait for confirmation of all required transactions when
bridging funds for MetaMask Pay.

Fix display of bridge receive line in transaction details summary.

Changelog

CHANGELOG entry: null

Related issues

Manual testing steps

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

Note

Waits for required bridge-related transactions to confirm before proceeding and fixes bridge receive/send summary titles and chain resolution.

  • MetaMask Pay (hook):
    • Explicitly tracks and waits for required transactions to reach confirmed via TransactionController:getState and :stateChange; rejects on dropped/failed with error context.
    • Uses BridgeStatusController:getState for immediate bridge status check; updates failure message to "Bridge failed".
    • Collects required tx IDs during submission and appends to requiredTransactionIds.
  • Messaging:
    • Grants TransactionController:getState action and TransactionController:stateChange event to init messenger.
  • Activity summary (UI):
    • Resolves receive chain from quote.destChainId (not status.destChain.chainId).
    • Splits loading titles into bridge_send_loading and bridge_receive_loading and applies in summary rendering.
  • Tests/Locales:
    • Adds tests for required tx confirm/fail flows and updated loading titles; adjusts mocks accordingly.
    • Updates en.json keys for send/receive loading titles.

Written by Cursor Bugbot for commit c5dfa17. This will update automatically on new commits. Configure here.

cf4df14

…ilures (#21287)

## **Description**

Explicitly wait for confirmation of all required transactions when
bridging funds for MetaMask Pay.

Fix display of bridge receive line in transaction details summary.

## **Changelog**

CHANGELOG entry: null

## **Related issues**

## **Manual testing steps**

## **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]
> Waits for and validates required bridge-related transactions, fixes
target chain resolution and loading titles in the transaction details
summary, and updates messenger, i18n, and tests accordingly.
> 
> - **MetaMask Pay / Bridge flow**:
> - Waits for all required transactions to confirm via
`TransactionController:stateChange`; rejects on dropped/failed with
error context.
> - Queries initial states using `TransactionController:getState` and
`BridgeStatusController:getState` before subscribing.
> - Logs collected required tx IDs and ensures bridge completion; error
text adjusted to `Bridge failed`.
> - **Messenger**:
> - Adds `TransactionController:getState` action and
`TransactionController:stateChange` event to
`TransactionControllerInit`.
>   - Allows `BridgeStatusController:getState` action.
> - **Transaction details summary (UI)**:
> - Derives receive chain from `quote.destChainId` (not
`status.destChain.chainId`).
> - Splits loading titles: `bridge_send_loading` and
`bridge_receive_loading`.
> - **i18n**:
> - Adds `transaction_details.summary_title.bridge_send_loading` and
`...bridge_receive_loading` keys.
> - **Tests**:
> - Update PayHook tests to simulate transaction state changes and
failures.
> - Adjust transaction summary tests for new loading titles and receive
chain handling.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
a7b9f7d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@runway-github runway-github bot requested review from a team as code owners October 17, 2025 12:14
@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Oct 17, 2025
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-M team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants