[pull] main from MetaMask:main#542
Merged
Merged
Conversation
## **Description** Phase 2 analytics migration (Batch 2-15): migrate mobile-platform's In App Browser components (PhishingModal, Options, GestureWebViewWrapper) from `useMetrics` to the new `useAnalytics` hook. **Reason**: Deprecate MetaMetrics in favour of the shared analytics utility and AnalyticsController. **Changes**: Browser `PhishingModal`, `Options`, and `GestureWebViewWrapper` now use `useAnalytics` from `app/components/hooks/useAnalytics/useAnalytics` and import `MetaMetricsEvents` from `app/core/Analytics`; test mocks updated to mock `useAnalytics` instead of `useMetrics`. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-297 (Batch 2-15) ## **Manual testing steps** ```gherkin Feature: In App Browser analytics Scenario: user triggers a browser flow event Given app is open and user is in the in-app browser When user performs an action that triggers analytics (e.g. swipe back/forward, pull to refresh, open in browser, add to favorites, phishing modal display) Then the event is tracked on Mixpanel ``` ## **Screenshots/Recordings** N/A – analytics migration, no UI change. ## **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** > Touches analytics instrumentation paths; if `useAnalytics` behavior differs from `useMetrics`, event tracking could regress, but no user-facing logic or security-sensitive flows are changed. > > **Overview** > Migrates in-app browser analytics wiring from `useMetrics` to the newer shared `useAnalytics` hook in `GestureWebViewWrapper`, `Options`, and `PhishingModal`, while keeping the same event emission sites. > > Updates `MetaMetricsEvents` imports to come from `app/core/Analytics` (instead of via `useMetrics`) and adjusts unit tests to mock `useAnalytics` accordingly. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit feabfa9. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** fix refresh staking balance after account switch <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: fix refresh staking balance after account switch ## **Related issues** Fixes: #26323 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/1a720a48-83e6-45e0-84e7-29b2cb3479e7 ### **After** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/826a347b-e003-4bd6-8816-8bec2b66c423 ## **Pre-merge author checklist** - [ ] 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). - [ ] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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** > Touches wallet balance refresh triggering, which could affect when/ how often balances are refreshed after navigation or account changes; test coverage reduces regression risk but performance/extra refreshes should be watched. > > **Overview** > Ensures wallet balance refresh runs after an account switch by adding `selectedInternalAccount` to the dependency list that triggers `AccountTrackerController.refresh` in `Wallet`. > > Updates `Wallet` tests to cover the new refresh-on-account-change behavior (using `waitFor` and a rerender with a different `AccountsController.internalAccounts.selectedAccount`) and refreshes related snapshots. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c934537. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
Market Insights "What’s driving the price?" previously showed source
icons and the sources sheet only for trends with articles. This PR adds
support for tweet-only trends as well.
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: null
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] 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).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] 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]
> **Low Risk**
> UI-only changes to Market Insights source rendering/selection with
added test coverage; no auth, payments, or persistence logic touched.
>
> **Overview**
> Enables Market Insights trends to surface **tweet-only sources** in
both the trend list and the “sources” bottom sheet, instead of only
supporting article-backed trends.
>
> Trend selection now opens the sources sheet when a trend has tweets
(even if it has no articles), the sheet renders tweet entries with an X
icon and opens tweet URLs, and trend items include `x.com` in their
displayed source icons. Adds/updates unit tests to cover tweet-only
trends and tweet source passing/URL opening, plus a small selector
memoization simplification in `MainNavigator`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
fe5970d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…0) (#26121) ## **Description** Fixes a set of race conditions in the WalletConnect v2 connection flow that caused a "stuck" or looping connection tray when scanning QR codes. The root cause was multiple layers of concurrent/duplicate processing: 1. **Duplicate OS deeplink delivery**: The OS can deliver the same deeplink 3-5 times via Linking + Branch. Each delivery called `pair()` and pushed a loading modal, stacking duplicate modals on screen. 2. **Duplicate relay events**: The WalletConnect relay can fire the same `session_proposal` event multiple times when duplicate `pair()` calls were made, causing duplicate AccountConnect screens. 3. **Concurrent proposal handling**: Rapid QR scans caused overlapping proposals to fight over shared state (`wc2Metadata`, navigation, approval queue). 4. **Navigation re-trigger loop**: Changes to the `pendingApprovals` Redux state re-triggered `PermissionApproval`'s `useEffect`, causing repeated navigation to AccountConnect for the same approval. Each issue is fixed at the layer where it occurs: | Layer | Guard | Purpose | |-------|-------|---------| | `connect()` | `seenTopics` + 5 s TTL | Blocks duplicate OS deeplink deliveries; TTL allows manual retries | | `onSessionProposal()` | `proposalLock` | Serializes concurrent proposals | | `_handleSessionProposal()` | `handledProposalIds` | Blocks duplicate relay events | | `PermissionApproval` | `lastNavigatedApprovalIdRef` | Prevents re-navigation for the same approval ID | Additionally fixes the `SDKLoading` Lottie animation not being visible. **Compatibility with #24040:** The `PermissionApproval` change keeps `pendingApprovals` in the `useEffect` deps (so the effect still re-runs when the queue changes, preventing stuck approvals). The added ref guard only skips navigation for the *same* approval ID; new approvals with a different ID navigate normally. ## **Changelog** CHANGELOG entry: Fixed WalletConnect connection tray getting stuck or looping when scanning QR codes, and fixed the loading animation not displaying during connection. ## **Related issues** Fixes: [WAPI-1070](https://consensyssoftware.atlassian.net/browse/WAPI-1070) ## **Manual testing steps** ```gherkin Feature: WalletConnect QR code connection Scenario: In-app QR scanner connection Given the user opens a dApp that supports WalletConnect (e.g. Coinbase Commerce) When the user scans the WC QR code using the in-app scanner Then a loading animation should briefly appear And the AccountConnect approval screen should appear once And tapping Connect should complete the connection Scenario: Camera app deeplink connection Given the user opens a dApp that supports WalletConnect When the user scans the WC QR code using the device camera app Then the loading modal should appear only once (not duplicated) And the AccountConnect screen should appear once And tapping Connect should complete the connection Scenario: Rapid repeated scans Given the user has completed one connection via QR scan When the user immediately scans another WC QR code Then each scan should produce exactly one connection flow And no flows should get stuck or loop Scenario: Retry after failed relay delivery Given the user scans a QR code but the WC relay fails to send a session_proposal When the user waits ~5 seconds and scans the same QR code again Then a new connection attempt should proceed normally ``` ## **Screenshots/Recordings** https://github.com/user-attachments/assets/843c71da-25ac-4b85-b26f-85cbc02961ae ## **Pre-merge author checklist** - [x] I've followed MetaMask Contributor Docs and MetaMask Mobile Coding Standards. - [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 format if applicable - [x] I've applied the right labels on the PR [WAPI-1070]: https://consensyssoftware.atlassian.net/browse/WAPI-1070?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches WalletConnect v2 connection/proposal control flow and approval navigation, so regressions could block or duplicate connection attempts. Changes are localized and include added guards and updated tests, reducing but not eliminating behavioral risk. > > **Overview** > Prevents WalletConnect v2 connection flows from looping/stacking by **deduplicating `connect()` calls per pairing topic (5s TTL)** and **serializing `session_proposal` handling** with a lock plus proposal-id dedupe. > > Fixes repeated AccountConnect navigation by guarding `PermissionApproval` against re-navigating for the same approval `metadata.id` even when `pendingApprovals` changes, and updates tests accordingly. Also fixes the SDK loading tray animation sizing by adding an explicit Lottie `aspectRatio`, and tightens logging/metadata cleanup on proposal rejection to avoid stale UI state. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 183bbe0. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…mReceipt cp-7.66.0 (#26342) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** The mUSD claim transaction amount was displaying the cumulative total reward (from Merkl distributor calldata `amounts[0]`) instead of the actual per-transaction payout. This caused incorrect amounts in the Activity list and transaction detail views — e.g., if a user made multiple claims, each one would show the running total rather than what was actually claimed in that specific transaction. The fix introduces `getClaimPayoutFromReceipt()` which extracts the real payout from the ERC-20 `Transfer` event in the transaction receipt logs (emitted when the Merkl distributor transfers mUSD to the user). This is used as the primary source for confirmed transactions across: - Activity list (`decodeMusdClaimTx`) - Transaction detail hero (`useClaimAmount`) - Confirmation flow (`useMerklClaimAmount`) ## **Changelog** CHANGELOG entry: Fixed mUSD claim transactions showing incorrect cumulative total instead of per-transaction payout amount ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: mUSD claim transaction amount display Scenario: user views a confirmed mUSD claim transaction in Activity Given user has made one or more mUSD claim transactions from this device And at least one claim transaction is confirmed When user navigates to the Activity tab Then the claim transaction shows the correct per-transaction payout amount (not cumulative total) Scenario: user views claim transaction details Given user has a confirmed mUSD claim transaction visible in Activity When user taps on the claim transaction Then the detail view shows the correct claimed amount matching the actual payout Scenario: user views a pending mUSD claim in the Activity list Given user has a pending mUSD claim transaction When user views the transaction in Activity Then the amount shows "Not available" until the transaction confirms And once confirmed, the correct payout amount appears ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **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** > Touches transaction amount display logic across multiple surfaces and relies on receipt log shape/topic matching; incorrect parsing could cause missing/incorrect amounts but does not affect signing or on-chain behavior. > > **Overview** > mUSD claim amount rendering is updated to use the **actual per-transaction payout** by extracting the mUSD `Transfer` event from the confirmed transaction receipt, replacing the prior calldata-based decode that returned cumulative totals. > > This introduces `getClaimPayoutFromReceipt()` in `Earn/utils/musd` (matches `Transfer` topic + mUSD token address + `from=MERKL_DISTRIBUTOR_ADDRESS` + `to=user`) and wires it into the Activity list (`decodeMusdClaimTx`), the transaction details hero (`useClaimAmount`), and the confirmations flow (`useMerklClaimAmount`, with receipt-first for confirmed txs and contract-computed fallback for pending). Tests are updated accordingly to validate log parsing and UI behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9674cf7. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** This PR adds the DeFi section to the new Homepage, displaying the user's top DeFi positions. **What changed:** - Added `useDeFiPositionsForHomepage` hook that fetches DeFi positions from the `DeFiPositionsController` Redux state - Positions are sorted by market value (descending) and limited to 5 - Added skeleton loading state with shimmer effect - Section only renders when the user has DeFi positions and the feature flag is enabled - Added comprehensive unit tests for both the hook and component **Why:** Part of the Homepage redesign to consolidate wallet views into a single scrollable homepage with sections for Tokens, Perpetuals, Predictions, DeFi, and NFTs. ## **Changelog** CHANGELOG entry: null ## **Related issues** Refs: [TMCU-420](https://consensyssoftware.atlassian.net/browse/TMCU-420) Refs: [TMCU-414](https://consensyssoftware.atlassian.net/browse/TMCU-414) Refs: [TMCU-457](https://consensyssoftware.atlassian.net/browse/TMCU-457) ## **Manual testing steps** ```gherkin Feature: DeFi section on Homepage Scenario: user views DeFi positions on homepage Given user has DeFi positions (e.g., Aave, Uniswap deposits) And the homepage sections feature flag is enabled And the DeFi feature flag is enabled When user navigates to the wallet homepage Then user sees a "DeFi" section with their top 5 positions And each position shows protocol name, icon, and value Scenario: user with no DeFi positions Given user has no DeFi positions And the homepage sections feature flag is enabled When user navigates to the wallet homepage Then the DeFi section is not displayed Scenario: DeFi positions loading Given user has DeFi positions And positions are still loading When user navigates to the wallet homepage Then user sees skeleton placeholders in the DeFi section ``` ## **Screenshots/Recordings** ### **Before** #### Feature flag OFF (no changes) <img width="300" alt="image" src="https://github.com/user-attachments/assets/b21b053e-db87-46f8-8607-9be9a77d5a20" /> #### Feature flag ON <img width="300" alt="image" src="https://github.com/user-attachments/assets/ad7f2305-1b35-43af-8b19-b805a746ba20" /> ### **After** #### Feature flag OFF (no changes) <img width="300" alt="image" src="https://github.com/user-attachments/assets/b21b053e-db87-46f8-8607-9be9a77d5a20" /> #### Feature flag ON <img width="300" alt="image" src="https://github.com/user-attachments/assets/142998bd-8a09-47ea-9831-c054a121feb2" /> ## **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. [TMCU-420]: https://consensyssoftware.atlassian.net/browse/TMCU-420?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [TMCU-414]: https://consensyssoftware.atlassian.net/browse/TMCU-414?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [TMCU-457]: https://consensyssoftware.atlassian.net/browse/TMCU-457?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > UI now depends on DeFiPositionsController-derived data shaping and sorting; regressions could hide positions or misorder them, but changes are scoped to homepage rendering and tests are included. > > **Overview** > Adds a functional **DeFi** homepage section that renders up to 5 DeFi protocol positions from controller-backed Redux state, including a skeleton loading UI and `privacyMode`-aware list items. > > Introduces `useDeFiPositionsForHomepage` to flatten multi-chain protocol data, derive loading/error/empty states, and sort/limit positions for display; the section now hides itself when disabled, empty, or errored, and exposes a no-op `refresh` via ref. Comprehensive unit tests were added/expanded for both the hook and the section behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit bce743b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description**
* Bump @metamask/assets-controllers from ^99.4.0 to 100.0.2 and
@metamask/phishing-controller from ^15.0.0 to ^16.3.0
* Wire up the new PhishingController:bulkScanTokens action into the
MultichainAssetsController messenger so the assets controller can
leverage bulk token phishing detection
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: bump assets-controllers and phishing-controller
versions
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] 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).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] 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**
> Primarily dependency upgrades plus a new phishing-scan action routed
through the controller messenger; risk is moderate due to behavior
changes coming from external controller version bumps and new
security-alerts API traffic.
>
> **Overview**
> Bumps `@metamask/assets-controllers` to `^100.0.2` and
`@metamask/phishing-controller` to `^16.3.0` (with corresponding
`yarn.lock` updates).
>
> Wires the new `PhishingController:bulkScanTokens` action into
`getMultichainAssetsControllerMessenger`, and updates API test mocks to
handle `POST
https://security-alerts.api.cx.metamask.io/token/scan-bulk`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
908ef8a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
) ## **Description** The transaction details bottom sheet was displaying a stale transaction status when opened while a transaction was pending. The `TransactionDetailsSheet` received the tx object as a static snapshot via navigation route params, so the status field never updated after the sheet was opened, leaving it stuck on "Pending" even after the transaction confirmed. The fix subscribes to live Redux state using `selectTransactionMetadataById` with the transaction ID. `currentTx` uses the live data when available and falls back to the static route param (e.g. if the transaction is no longer in the store). ## **Changelog** CHANGELOG entry: Fixed a bug where the transaction details bottom sheet would show a stale "Pending" status even after the transaction was confirmed. ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-426 ## **Manual testing steps** ```gherkin Feature: Transaction details bottom sheet live status Scenario: user opens transaction details while transaction is pending Given a transaction is submitted and in pending state And the Activity screen is visible When user taps the pending transaction to open the details bottom sheet And the transaction is confirmed on-chain while the bottom sheet is open Then the status in the bottom sheet updates from "Pending" to "Confirmed" And the user does not need to close and reopen the sheet to see the updated status ``` ## **Screenshots/Recordings** `~` ### **Before** https://github.com/user-attachments/assets/baed9058-6a3e-4881-91eb-49c7e0ad1968 ### **After** https://github.com/user-attachments/assets/36ca079c-bbf9-4c17-bb8c-9bdc792308ba ## **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 - [ ] I've included tests if applicable - [ ] 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** - [x] 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] > **Low Risk** > Small UI data-source change limited to the transaction details sheet; main risk is regressions if the selector returns `undefined` or the shape differs from the route param. > > **Overview** > The transaction details bottom sheet now subscribes to Redux for the latest transaction metadata via `selectTransactionMetadataById`, and uses this live object (falling back to the route param when missing). > > `TransactionDetailsSheet` is updated to render the header timestamp and pass `transactionObject` from this live `currentTx`, fixing cases where the sheet previously stayed stuck on stale pending state while open. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 310ab63. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )