Skip to content

refactor: rename CONTROLLER_MESSENGERS to MESSENGER_FACTORIES#28641

Merged
cryptodev-2s merged 5 commits intomainfrom
rename-controller-messengers-to-messenger-factories
Apr 10, 2026
Merged

refactor: rename CONTROLLER_MESSENGERS to MESSENGER_FACTORIES#28641
cryptodev-2s merged 5 commits intomainfrom
rename-controller-messengers-to-messenger-factories

Conversation

@cryptodev-2s
Copy link
Copy Markdown
Contributor

@cryptodev-2s cryptodev-2s commented Apr 10, 2026

Description

Rename the CONTROLLER_MESSENGERS constant to MESSENGER_FACTORIES to reflect that it provides messenger factories for all messenger clients (controllers + services).

3 files changed. PR 2 of 4 — depends on PR 1 (#28610).

  • PR 1: Core type renames (ControllerMessengerClient, etc.) (refactor: rename Controller types to MessengerClient types #28610)
  • PR 2 (this): CONTROLLER_MESSENGERSMESSENGER_FACTORIES
  • PR 3: initModularizedControllersinitMessengerClients + utils/Engine.ts renames
  • PR 4: Property renames (controllermessengerClient, getControllergetMessengerClient) in all init files + tests

Relates to WPC-916.

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/WPC-916

Manual testing steps

Feature: Messenger client init system

  Scenario: App builds and runs normally
    Given the app is built from this branch

    When user opens the app
    Then the app behaves identically to main (no runtime behavior change)

Screenshots/Recordings

N/A — no UI changes.

Before

N/A

After

N/A

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

Medium Risk
Low behavioral risk (rename-only) but touches engine initialization typing/lookup and includes a huge default-fixture.json update that could affect test expectations and increase review surface.

Overview
Renames the modularized messenger lookup constant from CONTROLLER_MESSENGERS to MESSENGER_FACTORIES and updates engine types/utilities to reference the new name (including generic return-type mappings used during messenger-client initialization).

Updates tests/framework/fixtures/json/default-fixture.json, removing legacy ComplianceController fields and significantly expanding PerpsController cached market/user data, plus adding a few new persisted fields (e.g., onboarding consent backfill, rewards ondoCampaignActivity, and preferences tokenOverviewChartType).

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

@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@cryptodev-2s cryptodev-2s force-pushed the rename-controller-messengers-to-messenger-factories branch from d94c76a to 56cc68e Compare April 10, 2026 13:43
@cryptodev-2s cryptodev-2s marked this pull request as ready for review April 10, 2026 13:44
@cryptodev-2s cryptodev-2s requested a review from a team as a code owner April 10, 2026 13:44
@cryptodev-2s cryptodev-2s added the team-core-platform Core Platform team label Apr 10, 2026
@cryptodev-2s cryptodev-2s self-assigned this Apr 10, 2026
@cryptodev-2s cryptodev-2s enabled auto-merge April 10, 2026 13:51
@cryptodev-2s
Copy link
Copy Markdown
Contributor Author

@metamaskbot update-mobile-fixture

@github-actions
Copy link
Copy Markdown
Contributor

E2E fixtures updated.

@github-actions github-actions bot requested a review from a team as a code owner April 10, 2026 15:57
@github-actions github-actions bot added size-XL risk-medium Moderate testing recommended · Possible bug introduction risk and removed size-S labels Apr 10, 2026
joaoloureirop
joaoloureirop previously approved these changes Apr 10, 2026
@github-actions github-actions bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Apr 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:

Changes Analysis:

  1. app/core/Engine/messengers/index.ts - Pure rename: CONTROLLER_MESSENGERSMESSENGER_FACTORIES. Confirmed complete (no remaining references to old name found via grep). This is a clean refactoring with no functional impact on runtime behavior.

  2. app/core/Engine/types.ts - Updates type references to match the rename. Pure TypeScript refactoring, no runtime impact.

  3. app/core/Engine/utils/utils.ts - Updates import and usage to match the rename. Pure refactoring.

  4. tests/framework/fixtures/json/default-fixture.json - Two meaningful changes:

    • ComplianceController: Removes blockedWallets: null and blockedWalletsLastFetched: 0 fields — these fields appear to have been removed from the controller's state schema (no references found in codebase), so this is a cleanup.
    • PerpsController: Adds a large cachedMarketDataByProvider dataset for hyperliquid:mainnet with ~100+ trading pairs. This pre-populates market data in the default fixture, which directly supports Perps E2E tests that need market data to be available without live API calls.

Tag Selection Rationale:

  • SmokePerps: The fixture now includes pre-populated cachedMarketDataByProvider for Perps. This directly affects Perps E2E tests which rely on this fixture state. Must verify Perps tests work correctly with the new fixture data.
  • SmokeWalletPlatform: Per tag description, Perps is a section inside the Trending tab. Changes to Perps views/data affect Trending, so SmokeWalletPlatform is required as a dependent tag.
  • SmokeConfirmations: Per SmokePerps tag description, when selecting SmokePerps, also select SmokeConfirmations (Add Funds deposits are on-chain transactions).

The Engine messenger rename is a pure refactor with no functional impact, so it doesn't require additional test coverage beyond what the fixture changes already warrant. The fixture changes are targeted and don't affect the core wallet flows broadly enough to warrant running all test suites.

Performance Test Selection:
The changes are: (1) a pure rename refactor in Engine messenger infrastructure with no runtime behavior change, and (2) fixture data updates for E2E tests. Neither change affects UI rendering performance, data loading pipelines, app startup, or any performance-sensitive code paths. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

@cryptodev-2s cryptodev-2s added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit 1eff744 Apr 10, 2026
102 of 103 checks passed
@cryptodev-2s cryptodev-2s deleted the rename-controller-messengers-to-messenger-factories branch April 10, 2026 18:22
@github-actions github-actions bot locked and limited conversation to collaborators Apr 10, 2026
@metamaskbot metamaskbot added the release-7.74.0 Issue or pull request that will be included in release 7.74.0 label Apr 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.74.0 Issue or pull request that will be included in release 7.74.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-XL team-core-platform Core Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants