From 140b2b45047d87f2d66f1904fb035fbcaec3d992 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 5 Mar 2024 13:11:11 -0330 Subject: [PATCH 1/4] chore: Remove `plist` resolution (#8835) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** The resolution for `plist` was added in #3987 to resolve a security advisory. At the time, the resolution was used to update the package, though a resolution wasn't needed to do this in the first place. Now that the package has been updated, this resolution is only having the effect of preventing further updates. ## **Related issues** N/A ## **Manual testing steps** N/A ## **Screenshots/Recordings** N/A ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained what problem this PR is solving and how it is solved. - [x] I've linked related issues - [x] I've included manual testing steps - [x] I've included screenshots/recordings if applicable - [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. - [x] I’ve properly set the pull request status: - [x] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **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. --- package.json | 1 - yarn.lock | 15 ++++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 897d3e0891e..e2f403ea6f8 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,6 @@ "@metamask/contract-metadata": "^2.1.0", "@metamask/approval-controller": "3.4.0", "@exodus/react-native-payments/validator": "^13.7.0", - "**/plist": "3.0.5", "**/minimist": "1.2.6", "@metamask/**/cross-fetch": "2.2.6", "react-native-svg-asset-plugin/sharp": "^0.30.5", diff --git a/yarn.lock b/yarn.lock index ed8168e74b9..639eb8ff966 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9941,7 +9941,7 @@ resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.5.tgz#325db42395cd49fe6c14057f9a900e427df8810e" integrity sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ== -"@xmldom/xmldom@^0.8.10", "@xmldom/xmldom@^0.x": +"@xmldom/xmldom@^0.8.10", "@xmldom/xmldom@^0.8.8", "@xmldom/xmldom@^0.x": version "0.8.10" resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.8.10.tgz#a1337ca426aa61cef9fe15b5b28e340a72f6fa99" integrity sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw== @@ -22619,13 +22619,14 @@ please-upgrade-node@^3.1.1, please-upgrade-node@^3.2.0: dependencies: semver-compare "^1.0.0" -plist@3.0.5, plist@3.1.0, plist@^3.0.1, plist@^3.0.5: - version "3.0.5" - resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.5.tgz#2cbeb52d10e3cdccccf0c11a63a85d830970a987" - integrity sha512-83vX4eYdQp3vP9SxuYgEM/G/pJQqLUz/V/xzPrzruLs7fz7jxGQ1msZ/mg1nwZxUSuOp4sb+/bEIbRrbzZRxDA== +plist@3.1.0, plist@^3.0.1, plist@^3.0.5: + version "3.1.0" + resolved "https://registry.yarnpkg.com/plist/-/plist-3.1.0.tgz#797a516a93e62f5bde55e0b9cc9c967f860893c9" + integrity sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ== dependencies: + "@xmldom/xmldom" "^0.8.8" base64-js "^1.5.1" - xmlbuilder "^9.0.7" + xmlbuilder "^15.1.1" plugin-error@^0.1.2: version "0.1.2" @@ -28249,7 +28250,7 @@ xmlbuilder@^15.1.1: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-15.1.1.tgz#9dcdce49eea66d8d10b42cae94a79c3c8d0c2ec5" integrity sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg== -xmlbuilder@^9.0.1, xmlbuilder@^9.0.7: +xmlbuilder@^9.0.1: version "9.0.7" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" integrity sha512-7YXTQc3P2l9+0rjaUbLwMKRhtmwg1M1eDf6nag7urC7pIPYLD9W/jmzQ4ptRSUbodw5S0jfoGTflLemQibSpeQ== From a73e159bf12f40a54d2fa4dd41a32f3d69a9f97f Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 5 Mar 2024 13:43:10 -0330 Subject: [PATCH 2/4] chore: Remove `cross-fetch` resolution (#8836) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** This resolution was added in #4249 to update the package in preparation for this package being updated in a controller update. That update happened long ago, and this resolution was not required to update the package in the first place. Today this just prevents the package from being updated. ## **Related issues** N/A ## **Manual testing steps** N/A ## **Screenshots/Recordings** N/A ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained what problem this PR is solving and how it is solved. - [x] I've linked related issues - [x] I've included manual testing steps - [x] I've included screenshots/recordings if applicable - [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. - [x] I’ve properly set the pull request status: - [x] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **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. --- package.json | 1 - yarn.lock | 22 ++++++++-------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index e2f403ea6f8..05463042058 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,6 @@ "@metamask/approval-controller": "3.4.0", "@exodus/react-native-payments/validator": "^13.7.0", "**/minimist": "1.2.6", - "@metamask/**/cross-fetch": "2.2.6", "react-native-svg-asset-plugin/sharp": "^0.30.5", "d3-color": "3.1.0", "tough-cookie": "4.1.3", diff --git a/yarn.lock b/yarn.lock index 639eb8ff966..8f308ccb4d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13362,15 +13362,7 @@ cron-parser@^4.5.0: dependencies: luxon "^3.2.1" -cross-fetch@2.2.6, cross-fetch@^3.1.5: - version "2.2.6" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.6.tgz#2ef0bb39a24ac034787965c457368a28730e220a" - integrity sha512-9JZz+vXCmfKUZ68zAptS7k4Nu8e2qcibe7WVZYps7sAgk5R8GYTc+T1WR0v1rlP9HxgARmOX1UTIJZFytajpNA== - dependencies: - node-fetch "^2.6.7" - whatwg-fetch "^2.0.4" - -cross-fetch@3.1.5, cross-fetch@^3.0.4: +cross-fetch@3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== @@ -13384,6 +13376,13 @@ cross-fetch@4.0.0: dependencies: node-fetch "^2.6.12" +cross-fetch@^3.0.4, cross-fetch@^3.1.5: + version "3.1.8" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.8.tgz#0327eba65fd68a7d119f8fb2bf9334a1a7956f82" + integrity sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg== + dependencies: + node-fetch "^2.6.12" + cross-spawn@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" @@ -27902,11 +27901,6 @@ webpack@5, webpack@^5.88.2: watchpack "^2.4.0" webpack-sources "^3.2.3" -whatwg-fetch@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" - integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== - whatwg-fetch@^3.0.0, whatwg-fetch@^3.4.1: version "3.6.2" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c" From 10690a058254c50108ebff02388b48f976ebe3f4 Mon Sep 17 00:00:00 2001 From: Pedro Pablo Aste Kompen Date: Tue, 5 Mar 2024 16:55:37 -0300 Subject: [PATCH 3/4] refactor(ramp): add provider name to sell tx events (#8728) --- .../UI/Ramp/Views/SendTransaction/SendTransaction.test.tsx | 4 ++++ .../UI/Ramp/Views/SendTransaction/SendTransaction.tsx | 3 ++- app/components/UI/Ramp/types/analytics.ts | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.test.tsx b/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.test.tsx index 7f8d13ca8cf..e32fbe12f3d 100644 --- a/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.test.tsx +++ b/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.test.tsx @@ -378,6 +378,7 @@ describe('SendTransaction View', () => { "fiat_out": 0, "order_id": "test-id-1", "payment_method_id": "/payments/instant-bank-transfer", + "provider_offramp": "Test (Staging)", }, ] `); @@ -432,6 +433,7 @@ describe('SendTransaction View', () => { "fiat_out": 0, "order_id": "test-id-1", "payment_method_id": "/payments/instant-bank-transfer", + "provider_offramp": "Test (Staging)", }, ] `); @@ -479,6 +481,7 @@ describe('SendTransaction View', () => { "fiat_out": 0, "order_id": "test-id-1", "payment_method_id": "/payments/instant-bank-transfer", + "provider_offramp": "Test (Staging)", }, ] `); @@ -529,6 +532,7 @@ describe('SendTransaction View', () => { "fiat_out": 0, "order_id": "test-id-1", "payment_method_id": "/payments/instant-bank-transfer", + "provider_offramp": "Test (Staging)", }, ] `); diff --git a/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.tsx b/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.tsx index 7db84663a0e..4bf46677aba 100644 --- a/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.tsx +++ b/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.tsx @@ -92,13 +92,14 @@ function SendTransaction() { const transactionAnalyticsPayload = useMemo( () => ({ - crypto_amount: orderData?.cryptoAmount, + crypto_amount: orderData?.cryptoAmount as string, chain_id_source: orderData?.cryptoCurrency.network.chainId, fiat_out: orderData?.fiatAmount, payment_method_id: orderData?.paymentMethod.id, currency_source: orderData?.cryptoCurrency.symbol, currency_destination: orderData?.fiatCurrency.symbol, order_id: order?.id, + provider_offramp: orderData?.provider.name, }), [order?.id, orderData], ); diff --git a/app/components/UI/Ramp/types/analytics.ts b/app/components/UI/Ramp/types/analytics.ts index 951e79afbb5..f7eb4bba4f2 100644 --- a/app/components/UI/Ramp/types/analytics.ts +++ b/app/components/UI/Ramp/types/analytics.ts @@ -278,6 +278,7 @@ interface RampTransaction { currency_source: string; currency_destination: string; order_id?: string; + provider_offramp: string; } interface RampQuotesExpanded { From 0c45fbfb082da964403fc230e84f20921d980598 Mon Sep 17 00:00:00 2001 From: tommasini <46944231+tommasini@users.noreply.github.com> Date: Tue, 5 Mar 2024 20:40:19 +0000 Subject: [PATCH 4/4] fix: network filtered view crash (#8846) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Network list filtered view crash when removing the network on the redux state on the add network view and then it's navigating back to the screen, but the list is not updated This needs to be fixed to move forward with E2E work ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** https://recordit.co/O3haA4sCxZ ### **Before** ### **After** ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've clearly explained what problem this PR is solving and how it is solved. - [ ] I've linked related issues - [ ] I've included manual testing steps - [ ] I've included screenshots/recordings if applicable - [ ] 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. - [ ] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **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. --- app/components/Views/Settings/NetworksSettings/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/components/Views/Settings/NetworksSettings/index.js b/app/components/Views/Settings/NetworksSettings/index.js index e3d0fc7f0d8..6419bcac3cc 100644 --- a/app/components/Views/Settings/NetworksSettings/index.js +++ b/app/components/Views/Settings/NetworksSettings/index.js @@ -155,7 +155,11 @@ class NetworksSettings extends PureComponent { this.updateNavBar(); }; - componentDidUpdate = () => { + componentDidUpdate = (prevProps) => { + if (this.props.networkConfigurations !== prevProps.networkConfigurations) { + this.handleSearchTextChange(this.state.searchString); + } + this.updateNavBar(); };