Skip to content

chore: bump @metamask/wallet to ^20.0.0 (2/3) - #39131

Merged
OGPoyraz merged 1 commit into
mainfrom
chore/wallet-20
Nov 10, 2026
Merged

OGPoyraz merged 1 commit into
mainfrom
chore/wallet-20

Conversation

@OGPoyraz

@OGPoyraz OGPoyraz commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Description

Stack (merge in order): 1/3 #39130 (wallet 19) → 2/3 #39131 (wallet 20) → 3/3 #39132 (wallet 21)

Based on chore/wallet-19; this diff shows only the wallet 20 step.

Bumps @metamask/wallet from ^19.1.0 to ^20.0.0.

Why

Wallet 20.0.0 constructs GeolocationController and GeolocationApiService. Mobile also constructed both, and registering them twice throws already registered.

Changes

  • Remove geolocationControllerInit, geolocationApiServiceInit and their messengers. Engine now reads GeolocationController from the wallet.
  • wallet-init/instance-options/geolocation-api-service.ts passes env (PRD for the production Ramp SDK environment, otherwise DEV, as before) and fetch.
  • The eager geolocation fetch at startup moves to wallet-init/listeners/geolocation-controller.ts. It is still skipped when the hydrated state already has a known location, for example from E2E fixtures.
  • tests/integration/harnesses/predict-next.ts wires the geolocation messengers the way the wallet does, since the mobile messenger factories are gone.

No resolution or other dependency changes. @metamask/geolocation-controller stays ^2.0.0.

Changelog

CHANGELOG entry: null

Related issues

Refs: #39126 (same change as a single PR)

Manual testing steps

Feature: GeolocationController owned by @metamask/wallet

  Scenario: geolocation is resolved on startup
    Given a fresh app start
    When the user opens Ramp, Perps, Rewards or Card
    Then region-gated content loads as before

  Scenario: Predict venue selection
    Given the user opens Predict
    When geolocation resolves
    Then the venue for the user's region is shown as before

Screenshots/Recordings

N/A: Engine wiring only, no UI changes.

Before

N/A

After

N/A

Pre-merge author checklist

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 to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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

Medium Risk
Changes Engine/wallet initialization for region-gated features (Ramp, Perps, Rewards, Card, Predict); behavior is intended to be unchanged but startup wiring is easy to regress.

Overview
Bumps @metamask/wallet to ^20.0.0, which now owns GeolocationController and GeolocationApiService. Mobile stops registering those in Engine (geolocationControllerInit, geolocationApiServiceInit, and their messengers/tests are removed), and Engine resolves GeolocationController via wallet.getInstance instead of the messenger client map.

Wallet startup now passes geolocationApiService instance options (Ramp SDK env → PRD/DEV plus fetch) and runs fetchInitialGeolocation from wallet-init/listeners/geolocation-controller, still skipping fetch when hydrated state already has a known location. CODEOWNERS and tests cover the new wallet-init paths; the PredictNext integration harness mirrors wallet messenger wiring after the mobile factories are gone.

Reviewed by Cursor Bugbot for commit ecef064. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added size-L pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels Nov 6, 2026
@metamask-ci metamask-ci Bot added the team-confirmations Push issues to confirmations team label Nov 6, 2026
@socket-security

socket-security Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​metamask/​wallet@​19.1.0 ⏵ 20.0.096 +310077 +199 +150

View full report

@OGPoyraz
OGPoyraz added this pull request to stack #39139 November 6, 2026 15:28
@OGPoyraz
OGPoyraz marked this pull request as ready for review November 9, 2026 08:10
@OGPoyraz
OGPoyraz requested review from a team as code owners November 9, 2026 08:10
*/
export function getGeolocationApiServiceInstanceOptions(): GeolocationApiServiceInstanceOptions {
const env =
getSdkEnvironment() === SdkEnvironment.Production ? Env.PRD : Env.DEV;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: This is something that we could definetely stop doing and replace by using a environment variable that would be set at builds.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented as a NIT since this is ramps team ownership

tommasini
tommasini previously approved these changes Nov 9, 2026
NicolasMassart
NicolasMassart previously approved these changes Nov 9, 2026
Base automatically changed from chore/wallet-19 to main November 9, 2026 12:00
@metamask-ci

metamask-ci Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Pre-merge author checklist has unchecked items (e.g. "I've applied the right labels on the PR (see labeling guidelines). Not required for external contributors."). Every box must be consciously checked — see docs/readme/ready-for-review.md.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@OGPoyraz OGPoyraz removed the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Smart E2E Test Selection

Selected E2E tags: ALL

AI Confidence: 100

E2E reasoning

Expand to read

This PR bumps @metamask/wallet from ^19.1.0 to ^20.0.0 (major version). It also changes Engine initialization: GeolocationApiService and GeolocationController are moved out of the legacy init map into wallet-init. The change touches core Engine wiring, which runs at app startup, and the wallet package underlies all controller instances. Geolocation feeds Ramps, Perps and Predictions region gating. Failures in Engine init would break every flow. This matches the hard-rule seed (global infrastructure change), so I'm keeping ALL tags with high risk.

View run

@OGPoyraz
OGPoyraz force-pushed the chore/wallet-20 branch 3 times, most recently from be7eb7f to 702350a Compare November 9, 2026 17:26
Wallet 20 constructs GeolocationController and GeolocationApiService.
Remove the mobile inits and messengers, pass GeolocationApiService
instance options (env follows the Ramp SDK environment), and keep the
eager geolocation fetch at startup in wallet-init.
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

@OGPoyraz
OGPoyraz disabled stacked auto-merge November 10, 2026 07:11
@OGPoyraz
OGPoyraz added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 1f6674c Nov 10, 2026
205 of 210 checks passed
@OGPoyraz
OGPoyraz deleted the chore/wallet-20 branch November 10, 2026 07:24
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 2026
@metamask-ci metamask-ci Bot added the release-8.21.0 Issue or pull request that will be included in release 8.21.0 label Nov 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.21.0 Issue or pull request that will be included in release 8.21.0 size-L team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants