Skip to content

Commit 76f659c

Browse files
temp+fix: patch profile-sync-controller to rename endpoint cp-13.0.0 (#34721)
<!-- 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** This PR patches `@metamask/profile-sync-controller` in order to follow up on the recent API changes that renamed an authentication endpoint from `/api/v2/profile/metametrics` to `/api/v2/profile/lineage` It also renames a hardcoded mock url to the new name scheme. The `core` PR that fixes the underlying issue is below: MetaMask/core#6211 When this core PR will be merged and the package updated on extension, this patch won't be needed anymore. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/34721?quickstart=1) ## **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: ## **Related issues** Related to: #34461 ## **Manual testing steps** 1. Complete onboarding 2. Go to the home page 3. Open network tab in the dev tools 4. Refresh the page 5. Verify that no call to `/api/v2/profile/metametrics` were done, and calls to `/api/v2/profile/lineage` happened instead ## **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 Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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-extension/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). - [x] 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.
1 parent cb1a4ae commit 76f659c

File tree

253 files changed

+11993
-7315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+11993
-7315
lines changed

.eslintrc.js

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020
parser: '@babel/eslint-parser',
2121
plugins: ['@metamask/design-tokens'],
2222
rules: {
23-
'@metamask/design-tokens/color-no-hex': 'error',
23+
'@metamask/design-tokens/color-no-hex': 'warn',
2424
'import/no-restricted-paths': [
2525
'error',
2626
{
@@ -390,35 +390,6 @@ module.exports = {
390390
},
391391
},
392392
},
393-
/**
394-
* Tailwind CSS
395-
*/
396-
{
397-
files: [
398-
'ui/pages/design-system/**/*.{ts,tsx}',
399-
// Add your workspace if you'd like to start using tailwind css,
400-
// for example:
401-
// 'ui/pages/your-page/**/*.{ts,tsx}',
402-
],
403-
plugins: ['tailwindcss'],
404-
rules: {
405-
// Tailwind CSS rules - same as design system
406-
'tailwindcss/classnames-order': 'error',
407-
'tailwindcss/enforces-negative-arbitrary-values': 'error',
408-
'tailwindcss/enforces-shorthand': 'error',
409-
'tailwindcss/no-arbitrary-value': 'off', // There are legitimate reasons to use arbitrary values but we should specifically error on static colors
410-
'tailwindcss/no-custom-classname': 'error',
411-
'tailwindcss/no-contradicting-classname': 'error',
412-
'tailwindcss/no-unnecessary-arbitrary-value': 'error',
413-
},
414-
settings: {
415-
tailwindcss: {
416-
callees: ['twMerge'],
417-
config: 'tailwind.config.js',
418-
classRegex: ['^(class(Name)?)$'],
419-
},
420-
},
421-
},
422393
/**
423394
* Mocha tests
424395
*

.github/CODEOWNERS

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ lavamoat/ @MetaMask/extension-devs @MetaMask/policy-r
1919
# file is responsible, at present, for loading the snaps execution environment
2020
# for MV3. Any changes to this file should require at least one member of the
2121
# snaps development team to review and approve the changes.
22-
offscreen/scripts/offscreen.ts @MetaMask/core-platform
22+
offscreen/scripts/offscreen.ts @MetaMask/snaps-devs
2323

2424

2525
# The privacy-snapshot.json file includes a list of all hosts that the
@@ -91,13 +91,13 @@ app/scripts/controllers/swaps @MetaMask/swaps-engineers
9191
**/ramps/** @MetaMask/ramp
9292

9393
# Snaps
94-
**/snaps/** @MetaMask/core-platform
95-
shared/constants/permissions.ts @MetaMask/core-platform
96-
ui/helpers/utils/permission.js @MetaMask/core-platform
97-
app/scripts/constants/snaps.ts @MetaMask/core-platform
94+
**/snaps/** @MetaMask/snaps-devs
95+
shared/constants/permissions.ts @MetaMask/snaps-devs
96+
ui/helpers/utils/permission.js @MetaMask/snaps-devs
97+
app/scripts/constants/snaps.ts @MetaMask/snaps-devs
9898

9999
# Co-owned by Confirmations and Snaps
100-
ui/components/app/metamask-template-renderer @MetaMask/confirmations @MetaMask/core-platform
100+
ui/components/app/metamask-template-renderer @MetaMask/confirmations @MetaMask/snaps-devs
101101

102102
# Wallet UX
103103
ui/components/app/whats-new-popup @MetaMask/wallet-ux

.github/scripts/get-next-semver-version.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@ jobs:
4949
skip-allow-scripts: true
5050
yarn-custom-url: ${{ vars.YARN_URL }}
5151

52-
# Need to cache `.metamask` folder for the anvil binary
53-
- name: Cache .metamask folder
54-
uses: actions/cache/save@v4
55-
with:
56-
path: .metamask
57-
key: .metamask-${{ hashFiles('yarn.lock') }}
58-
5952
lint-workflows:
6053
name: Lint workflows
6154
uses: metamask/github-tools/.github/workflows/lint-workflows.yml@1299bb1de0c6974ae6d0a32c7e8897fe168239ac
@@ -193,7 +186,6 @@ jobs:
193186
run-benchmarks:
194187
uses: ./.github/workflows/run-benchmarks.yml
195188
needs:
196-
- prep-deps
197189
- build-test-browserify
198190
- build-test-webpack
199191

.github/workflows/run-benchmarks.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,8 @@ jobs:
3131
skip-allow-scripts: true
3232
yarn-custom-url: ${{ vars.YARN_URL }}
3333

34-
- name: Restore .metamask folder
35-
id: restore-metamask
36-
uses: actions/cache/restore@v4
37-
with:
38-
path: .metamask
39-
key: .metamask-${{ hashFiles('yarn.lock') }}
40-
fail-on-cache-miss: false
41-
42-
- name: Install anvil if cache missed
43-
if: ${{ steps.restore-metamask.outputs.cache-hit != 'true'}}
34+
# not installed by checkout-and-setup when cache is restored
35+
- name: Install anvil
4436
run: yarn mm-foundryup
4537

4638
- name: Download artifact '${{ env.ARTIFACT_NAME }}'

.github/workflows/run-e2e.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
name: ${{ inputs.test-suite-name }}${{ inputs.matrix-total > 1 && format(' ({0})', inputs.matrix-index) || '' }}
4444
runs-on: ubuntu-latest
4545
container:
46-
image: ghcr.io/metamask/metamask-extension-e2e-image:v1.0.0
46+
image: ghcr.io/consensys-vertical-apps/metamask-extension-e2e-image:v1.0.0
4747
credentials:
4848
username: ${{ github.actor }}
4949
password: ${{ secrets.GITHUB_TOKEN }}
@@ -68,16 +68,8 @@ jobs:
6868
is-high-risk-environment: false
6969
skip-allow-scripts: true
7070

71-
- name: Restore .metamask folder
72-
id: restore-metamask
73-
uses: actions/cache/restore@v4
74-
with:
75-
path: .metamask
76-
key: .metamask-${{ hashFiles('yarn.lock') }}
77-
fail-on-cache-miss: false
78-
79-
- name: Install anvil if cache missed
80-
if: ${{ steps.restore-metamask.outputs.cache-hit != 'true'}}
71+
# not installed by checkout-and-setup when cache is restored
72+
- name: Install anvil
8173
run: yarn mm-foundryup
8274

8375
- name: Download build artifact

.github/workflows/stable-branch-sync.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.yarn/patches/@metamask-assets-controllers-npm-73.0.0-a36b91b0e4.patch renamed to .yarn/patches/@metamask-assets-controllers-npm-72.0.0-781cbafc4f.patch

File renamed without changes.

.yarn/patches/@metamask-bridge-controller-npm-34.0.0-1e7cf1bef5.patch

Lines changed: 86 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
diff --git a/dist/bridge-status-controller.cjs b/dist/bridge-status-controller.cjs
2+
index 84e7c4816afba3765e9e30e9fd403b20e6883723..1c1eaef962391a8add1db122ad418ed9e12e4503 100644
3+
--- a/dist/bridge-status-controller.cjs
4+
+++ b/dist/bridge-status-controller.cjs
5+
@@ -295,11 +295,7 @@ class BridgeStatusController extends (0, polling_controller_1.StaticIntervalPoll
6+
if (!selectedAccount?.metadata?.snap?.id) {
7+
throw new Error('Failed to submit cross-chain swap transaction: undefined snap id');
8+
}
9+
- const bridgeFeatureFlags = (0, bridge_controller_1.getBridgeFeatureFlags)(this.messagingSystem);
10+
- const request = bridgeFeatureFlags?.chains?.[keyring_api_1.SolScope.Mainnet]
11+
- ?.isSnapConfirmationEnabled
12+
- ? (0, transaction_1.getKeyringRequest)(quoteResponse, selectedAccount)
13+
- : (0, transaction_1.getClientRequest)(quoteResponse, selectedAccount);
14+
+ const request = (0, transaction_1.getClientRequest)(quoteResponse, selectedAccount);
15+
const requestResponse = (await this.messagingSystem.call('SnapController:handleRequest', request));
16+
// The extension client actually redirects before it can do anytyhing with this meta
17+
const txMeta = (0, transaction_1.handleSolanaTxResponse)(requestResponse, quoteResponse, selectedAccount);
18+
diff --git a/dist/bridge-status-controller.mjs b/dist/bridge-status-controller.mjs
19+
index d1c76aaf9bffca698520f5c8903f1c8151064f3b..aee7d633a2a4eadab73c2812fd7e30f8fe57a4e7 100644
20+
--- a/dist/bridge-status-controller.mjs
21+
+++ b/dist/bridge-status-controller.mjs
22+
@@ -292,11 +292,7 @@ export class BridgeStatusController extends StaticIntervalPollingController() {
23+
if (!selectedAccount?.metadata?.snap?.id) {
24+
throw new Error('Failed to submit cross-chain swap transaction: undefined snap id');
25+
}
26+
- const bridgeFeatureFlags = getBridgeFeatureFlags(this.messagingSystem);
27+
- const request = bridgeFeatureFlags?.chains?.[SolScope.Mainnet]
28+
- ?.isSnapConfirmationEnabled
29+
- ? getKeyringRequest(quoteResponse, selectedAccount)
30+
- : getClientRequest(quoteResponse, selectedAccount);
31+
+ const request = getClientRequest(quoteResponse, selectedAccount);
32+
const requestResponse = (await this.messagingSystem.call('SnapController:handleRequest', request));
33+
// The extension client actually redirects before it can do anytyhing with this meta
34+
const txMeta = handleSolanaTxResponse(requestResponse, quoteResponse, selectedAccount);

0 commit comments

Comments
 (0)