[pull] main from MetaMask:main#781
Merged
Merged
Conversation
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until this PR meets the canonical
Definition of Ready For Review in `docs/readme/ready-for-review.md`.
In short: the template must be materially complete (not just section
titles
present), all status checks must be currently passing, and the only
expected
follow-up commits must be reviewer-driven.
-->
## **Description**
Upgrade QS version
## **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**
<!--
Every checklist item must be consciously assessed before marking this PR
as
"Ready for review". A checked box means you deliberately considered that
responsibility, not that you literally performed every action listed.
Unchecked boxes are ambiguous: they are not an implicit "N/A" and they
are not
a silent "skip". See `docs/readme/ready-for-review.md` for the full
checklist
semantics.
-->
- [ ] 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.
#### Performance checks (if applicable)
- [ ] I've tested on Android
- Ideally on a mid-range device; emulator is acceptable
- [ ] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [ ] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example
For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).
## **Pre-merge reviewer checklist**
<!--
Reviewer checklist items follow the same semantics as the author
checklist: an
unchecked box is ambiguous, a checked box means the reviewer consciously
assessed that responsibility. See `docs/readme/ready-for-review.md`.
-->
- [ ] 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]
> <sup>[Cursor Bugbot](https://cursor.com/bugbot) is generating a
summary for commit 8782ffc. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description** Enable Metro's Node-style `exports` field resolution by setting `resolver.unstable_enablePackageExports: true` in `metro.config.js`. The flag was added but immediately disabled during the RN 0.81.5 / Expo SDK 54 upgrade ([#29195](#29195)) out of caution: at the time, LavaMoat's `lockdownSerializer` was failing because enabling the flag changed module-ID assignment and `hardenIntrinsics` was firing before `require` was set up ([expo/expo#36551](expo/expo#36551)). That ordering issue no longer reproduces locally with the current Metro + LavaMoat versions, so the defensive disable is no longer needed. ### What changes - `metro.config.js`: remove the `unstable_enablePackageExports` disable + explanatory comment; the flag is now `true`. ### What does NOT change - `babel.config.js` is untouched. The `dynamicImportToRequire` visitor stays in place — it turned out to be load-bearing for Jest (not Hermes): `NavigationService.ts` calls `import('../AgenticService/AgenticService')` inside an `if (__DEV__) { }` branch that is active in the Jest VM, and Node's VM refuses dynamic `import()` callbacks without `--experimental-vm-modules`. Anything that touches `NavigationService` (e.g. `PerpsTutorialCarousel.view.test.tsx` via `setupFirstTimeTutorial`) needs the transform. - The manual `@ledgerhq/*` `lib/<subpath>` fallback in `resolveRequest` is kept as-is and can be cleaned up in a follow-up once Metro's exports resolution is verified to handle those paths directly. ## **Risk** **Medium.** `unstable_enablePackageExports` changes how every package with an `exports` field resolves its modules. The app-wide blast radius means LavaMoat lockdown ordering, Snaps, and any package that ships an `exports` map (Ledger, Predict, Perps, etc.) all need to be exercised before merge. ## **Changelog** CHANGELOG entry: null ## **Related issues** Follow-up to: [#29195](#29195) ## **Manual testing steps** Before merge: 1. **Release build (Hermes bytecode compile)** — produce an iOS release `.app` and confirm the JS bundle is present and the app cold-starts under Hermes. 2. **LavaMoat lockdown cold start** — launch the release build and confirm lockdown completes without `hardenIntrinsics` ordering errors. 3. **Snaps install + invoke** — install a Snap and invoke it end-to-end. 4. **MYX-enabled Perps path** — exercise the `PerpsController` MYX provider dynamic-import path. 5. **Power-user wallet cold start** — import a power-user SRP (many accounts + tokens) and verify cold-start time has not regressed. ## **Screenshots/Recordings** ### **Before** ### **After** ## **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. ### Performance checks (if applicable) - [ ] I've tested on Android - [ ] I've tested with a power user scenario - [ ] I've instrumented key operations with Sentry traces for production performance metrics ## **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** > Enabling Node-style `exports` resolution changes module resolution semantics across many dependencies, which can impact bundling, runtime behavior, and LavaMoat serialization/lockdown ordering. Risk is mostly integration/regression in build/startup paths rather than localized logic changes. > > **Overview** > **Metro now resolves package `exports` maps.** The Metro config flips `resolver.unstable_enablePackageExports` to `true`, removing the previous defensive disable. > > This changes how modules are resolved for packages that define an `exports` field, potentially altering bundle module IDs and dependency entrypoint selection during build/runtime. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 78a083c. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: tommasini <46944231+tommasini@users.noreply.github.com>
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until this PR meets the canonical Definition of Ready For Review in `docs/readme/ready-for-review.md`. In short: the template must be materially complete (not just section titles present), all status checks must be currently passing, and the only expected follow-up commits must be reviewer-driven. --> ## **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? --> Adds `feature:social` Sentry error instrumentation for Top Traders and Quick Buy, following existing Logger.error` + tags pattern. - New helpers in `socialServiceTelemetry.ts`: `buildSocialLoggerErrorOptions`, `formatSocialExtraMessage`, `SOCIAL_SENTRY_FEATURE` - **Top Traders:** leaderboard fetch/refresh + pull-to-refresh (`useTopTraders`, `TopTradersView`) - **Quick Buy:** quote fetch + submit tx (`useQuickBuyQuotes`, `useQuickBuyBottomSheet`) - more WIP... Events are sent via existing `Logger.error` > Sentry on release builds (metrics opt-in, DSN). Search in Sentry: `feature:social`, `surface:top_traders`, `surface:quick_buy`. Sentry **alert rules** (Slack/email on `feature:social`) are out of scope for this PR and will be configured separately. ## Out of scope (follow-up) - `feature:ai` for digests / market insights ## **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** Resolves: [TSA-150](https://consensyssoftware.atlassian.net/browse/TSA-150) ## **Manual testing steps** - [x] `yarn jest app/util/social/socialServiceTelemetry.test.ts` - [x] `yarn jest` on `useTopTraders.test.ts`, `TopTradersView.test.tsx` - [ ] Verify events in Sentry after release/internal build (not Metro dev — `Logger.error` no-ops in `__DEV__`) ## **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** <!-- Every checklist item must be consciously assessed before marking this PR as "Ready for review". A checked box means you deliberately considered that responsibility, not that you literally performed every action listed. Unchecked boxes are ambiguous: they are not an implicit "N/A" and they are not a silent "skip". See `docs/readme/ready-for-review.md` for the full checklist semantics. --> - [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. #### Performance checks (if applicable) - [ ] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [ ] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [ ] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** <!-- Reviewer checklist items follow the same semantics as the author checklist: an unchecked box is ambiguous, a checked box means the reviewer consciously assessed that responsibility. See `docs/readme/ready-for-review.md`. --> - [ ] 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. [TSA-150]: https://consensyssoftware.atlassian.net/browse/TSA-150?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Changes are limited to error logging and test expectations; user flows and API behavior are unchanged aside from Quick Buy failures now going through Logger/Sentry instead of console. > > **Overview** > Standardizes **Social** failures for Sentry with a shared `feature:social` tagging model in `socialServiceTelemetry.ts`, aligned with existing Perps-style `Logger.error` options. > > **Telemetry helpers:** Adds `buildSocialLoggerErrorOptions`, `reportSocialServiceFailure`, `useLogSocialQueryError`, and `formatSocialQueryErrorMessage`; renames `legacyMessage` → `extraMessage` in `buildSocialErrorExtras`; extends surfaces/endpoints (e.g. `trader_profile`, `follow`/`unfollow`, Quick Buy without a SocialService endpoint). > > **Call-site migration:** Social react-query hooks (`useTopTraders`, `useFollowedTraders`, `useTraderProfile`, `useTraderPositions`, `useTraderPosition`) drop per-hook `useEffect` logging in favor of `useLogSocialQueryError` + structured refresh failures. **Quick Buy** replaces `console.error` with `Logger.error` on quote fetch and tx submit (chain tags). **Top Traders** pull-to-refresh and **follow/unfollow** use the same structured payload. Tests assert `tags`/`extras` instead of plain string second arguments. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d1fa812. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: António Regadas <antonio.regadas@consensys.net>
## Description
This PR fixes two UI issues related to fiat payment method selection in
the confirmation flow:
### 1. Hide PayAccountSelector when fiat payment method is selected
When a fiat payment method (`selectedFiatPaymentMethodId`) is active,
the `PayAccountSelector` component should not be rendered in
`CustomAmountInfo`. The guard was added to both the keyboard-visible and
result-ready states. Test coverage added to verify the new behavior.
### 2. Fix dark mode icon color for fiat payment method row
`PaymentMethodIcon` in `PayWithFiatPaymentMethodRow` was receiving
`color={undefined}` when not disabled, causing react-native-vector-icons
to default to black — invisible in dark mode. Fixed by using
`colors.icon.default` from the theme, which resolves to the correct
color in both light and dark modes.
## Changes
- `custom-amount-info.tsx`: Added `!selectedFiatPaymentMethodId` guard
to `PayAccountSelector` rendering
- `custom-amount-info.test.tsx`: Added test for PayAccountSelector
hidden when fiat payment method selected
- `pay-with-row.tsx`: Changed `PaymentMethodIcon` color from `undefined`
to `colors.icon.default`
## Related to
- Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1415
## Recording and screenshots
### After
https://github.com/user-attachments/assets/51e483dc-7073-4bd0-ac14-0a115323d2dd
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Small confirmation UI guards and theme token for an icon; no auth,
transaction, or payment logic changes.
>
> **Overview**
> When a **fiat payment method** is selected on the custom amount
confirmation screen, **`PayAccountSelector` is hidden** so users are not
prompted to pick a crypto pay account alongside fiat. The same guard
applies in both the in-progress (keyboard) and post-**Done** layouts.
>
> The **Pay with** row for fiat methods now uses
**`colors.icon.default`** for `PaymentMethodIcon` when enabled, fixing
icons that looked wrong (e.g. black) in **dark mode**.
>
> Tests assert the account selector stays off when
`selectedPaymentMethodId` is set.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
4fa7eab. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…30353) ## **Description** The PayWithModal screen in the Perps native stack only had `transparentModalScreenOptions` (`presentation: 'transparentModal'`) without `clearNativeStackNavigatorOptions` (`animation: 'none'`). This caused a double slide-up animation: the native stack animated the transparent screen from bottom to top, then the BottomSheet component inside it played its own slide-up animation. ## **Root Cause** `transparentModalScreenOptions` sets `presentation: 'transparentModal'` but does not set `animation: 'none'`. The default native modal animation kicks in, creating a visible slide of the transparent overlay before the BottomSheet animates. ## **Fix** Added `...clearNativeStackNavigatorOptions` before `...transparentModalScreenOptions` on the PayWithModal screen in the Perps native stack. This makes the screen appear instantly so only the BottomSheet's own animation plays. The App.tsx JS stack registration was already correct — its parent navigator sets `animationEnabled: false` globally. ### Before: https://github.com/user-attachments/assets/e7f32bd4-5f1a-4089-b7bc-cc1321f1f662 ### After: https://github.com/user-attachments/assets/b255fc4a-c7dc-4c38-8034-39cbc5078727 ## **Changes** - `app/components/UI/Perps/routes/index.tsx` — Added `clearNativeStackNavigatorOptions` to PayWithModal screen options <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Single navigation option change for one Perps screen; no auth, data, or business-logic impact. > > **Overview** > Fixes a **double slide-up** when opening the pay-with token selector from the Perps native stack: the stack was animating the transparent modal while the inner `BottomSheet` also animated. > > The `CONFIRMATION_PAY_WITH_MODAL` screen now spreads **`clearNativeStackNavigatorOptions`** (including `animation: 'none'`) before **`transparentModalScreenOptions`**, matching the sibling **`CONFIRMATION_PAY_WITH_BOTTOM_SHEET`** screen and other Perps modal routes so only the bottom sheet animates. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 70eef9a. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/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 : )