[pull] main from MetaMask:main#637
Merged
pull[bot] merged 3 commits intoReality2byte:mainfrom Mar 27, 2026
Merged
Conversation
…cs to useAnalytics (#27985) --- ## **Description** <!-- 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? --> Replaces the deprecated `useMetrics` hook with the new `useAnalytics` hook in `useGoToPortfolioBridge.ts`. This is part of the broader C3 analytics migration (#26686) that standardises all analytics calls across the mobile app to use the new `useAnalytics` abstraction instead of `useMetrics`. The hook interface is identical (`trackEvent`, `createEventBuilder`), so no behaviour changes. ## **Changelog** CHANGELOG entry: null ## **Related issues** Refs: #26814 ## **Manual testing steps** N/A ## **Screenshots/Recordings** ### **Before** N/A ### **After** N/A ## **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. <!-- Generated with the help of the pr-description AI skill --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: swaps analytics hook wiring and adds legacy `action`/`name` properties to the emitted event, without changing navigation or URL-building logic. > > **Overview** > Updates `useGoToPortfolioBridge` to use the new `useAnalytics` hook instead of deprecated `useMetrics` for `BRIDGE_LINK_CLICKED` tracking. > > Also explicitly adds legacy `action` and `name` properties to the tracked event payload to preserve existing analytics fields during the migration. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 4b45bf0. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
… useAnalytics (#27983) --- ## **Description** <!-- 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? --> Replaces the deprecated `useMetrics` hook with the new `useAnalytics` hook in `TabBar.tsx`. This is part of the broader C3 analytics migration (#26686) that standardises all analytics calls across the mobile app to use the new `useAnalytics` abstraction instead of `useMetrics`. The hook interface is identical (`trackEvent`, `createEventBuilder`), so no behaviour changes. ## **Changelog** CHANGELOG entry: null ## **Related issues** Refs: #26814 ## **Manual testing steps** N/A ## **Screenshots/Recordings** ### **Before** N/A ### **After** N/A ## **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. <!-- Generated with the help of the pr-description AI skill --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk refactor that swaps a deprecated analytics hook for its replacement while keeping the same `trackEvent`/`createEventBuilder` interface; main risk is accidental import/path or hook wiring issues affecting event emission. > > **Overview** > Updates `TabBar.tsx` to use the new `useAnalytics` hook instead of the deprecated `useMetrics`, leaving the existing `trackEvent`/`createEventBuilder` usage intact (e.g., for the wallet actions button click event). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c31f62f. 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** <!-- 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? --> Recently we released `@metamask/messenger` 1.0.0, and we upgraded all core packages to use this version. Unfortunately, this makes it impossible to bump a single core package in this repo. Doing so means that there are two versions of this package in the dependency tree in use at the same time, and this results in a type error, since the `Messenger` type from 1.0.0 is incompatible with the `Messenger` type from previous versions due to the use of private fields (see <microsoft/TypeScript#62486> and other TypeScript issues). To truly fix this, we would have to upgrade all core packages. This is non-trivial, so to unblock teams we force-resolve `@metamask/messenger` to 1.0.0 across the dependency tree. This should be safe as there are no breaking changes in 1.0.0 (this release was just a formality to communicate that the package is now stable). ## **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** (N/A) ## **Manual testing steps** Should be already covered by CI, but just in case, try upgrading a core package. `yarn lint:tsc` should still pass. ## **Screenshots/Recordings** (N/A) ### **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 - [ ] 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** > Low risk dependency-resolution change; main risk is unforeseen runtime/type incompatibilities if any transitive dependency relied on `@metamask/messenger@0.x` behavior. > > **Overview** > Forces the dependency tree to use `@metamask/messenger@^1.0.0` by adding a Yarn `resolutions` override, preventing multiple `@metamask/messenger` versions from being installed simultaneously. > > Updates the direct dependency and lockfile to `@metamask/messenger@1.0.0`, removing the locked `0.3.0` entry. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c6b17de. 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 : )