diff --git a/.depcheckrc.yml b/.depcheckrc.yml index f51f487fd9b2..e8fe7a446ec7 100644 --- a/.depcheckrc.yml +++ b/.depcheckrc.yml @@ -2,10 +2,10 @@ ignores: - '@metamask/oss-attribution-generator' - 'webpack-cli' + - '@react-native-community/datetimepicker' - '@react-native-community/slider' - 'patch-package' - '@lavamoat/allow-scripts' - - 'babel-plugin-inline-import' # This is used on the patch for TokenRatesController of Assets controllers, for we to be able to use the last version of it - cockatiel diff --git a/.detoxrc.js b/.detoxrc.js index ad9535112611..d637d3c937c0 100644 --- a/.detoxrc.js +++ b/.detoxrc.js @@ -26,7 +26,7 @@ module.exports = { configurations: { 'ios.sim.apiSpecs': { device: 'ios.simulator', - app: 'ios.qa', + app: 'ios.debug', testRunner: { args: { "$0": "node e2e/api-specs/run-api-spec-tests.js", @@ -41,9 +41,10 @@ module.exports = { device: 'ios.simulator', app: 'ios.release', }, - 'ios.sim.qa': { - device: 'ios.simulator', - app: 'ios.qa', + // because e2e run on debug mode in bitrise + 'android.emu.bitrise.debug': { + device: 'android.bitrise.emulator', + app: 'android.bitrise.debug', }, 'android.emu.debug': { @@ -85,21 +86,32 @@ module.exports = { binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/MetaMask.app', build: 'yarn start:ios:e2e', }, - 'ios.qa': { + 'ios.release': { type: 'ios.app', binaryPath: - 'ios/build/Build/Products/Release-iphonesimulator/MetaMask-QA.app', - build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='qa' yarn build:ios:qa", + 'ios/build/Build/Products/Release-iphonesimulator/MetaMask.app', + build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='production' yarn build:ios:release:e2e", + }, + 'android.bitrise.debug': { + type: 'android.apk', + binaryPath: 'android/app/build/outputs/apk/prod/debug/app-prod-debug.apk', + build: 'yarn start:android:e2e', }, 'android.debug': { type: 'android.apk', binaryPath: 'android/app/build/outputs/apk/prod/debug/app-prod-debug.apk', build: 'yarn start:android:e2e', }, + 'android.release': { + type: 'android.apk', + binaryPath: + 'android/app/build/outputs/apk/prod/release/app-prod-release.apk', + build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='production' yarn build:android:release:e2e", + }, 'android.qa': { type: 'android.apk', binaryPath: 'android/app/build/outputs/apk/qa/release/app-qa-release.apk', - build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='qa' yarn build:android:qa", + build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='qa' yarn build:android:qa:e2e", }, }, }; diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 594f7f4bf175..9de39ff6af2a 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -2,5 +2,3 @@ 57afe4ca921d85a51a923470239ca977fccbd1ae # Standardize prettier configuration https://github.com/MetaMask/metamask-mobile/pull/4182 bdb7f37c90e4fc923881a07fca38d4e77c73a579 -# Fix mixed tabs and spaces https://github.com/MetaMask/metamask-mobile/pull/1379 -9f9a1121c6899e06d4aeef29017bb479df142adb diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a483a7157ca7..727f5b7c4d0f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,7 +4,7 @@ * @MetaMask/mobile-devs # Design System Team -app/component-library/ @MetaMask/design-system-engineers +app/component-library/ @MetaMask/design-system-engineers @MetaMask/mobile-platform # Platform Team patches/ @MetaMask/mobile-platform @@ -94,25 +94,10 @@ app/components/Views/NftDetails @MetaMask/metamask-assets app/reducers/collectibles @MetaMask/metamask-assets # UX Team -app/components/Views/AccountActions @MetaMask/wallet-ux -app/components/Views/AccountSelector @MetaMask/wallet-ux -app/components/Views/AddressQRCode @MetaMask/wallet-ux -app/components/Views/EditAccountName @MetaMask/wallet-ux -app/components/Views/LockScreen @MetaMask/wallet-ux -app/components/Views/Login @MetaMask/wallet-ux -app/components/Views/NetworkConnect @MetaMask/wallet-ux -app/components/Views/NetworkSelector @MetaMask/wallet-ux -app/components/Views/Onboarding @MetaMask/wallet-ux -app/components/Views/OnboardingCarousel @MetaMask/wallet-ux -app/components/Views/OnboardingSuccess @MetaMask/wallet-ux -app/components/Views/QRAccountDisplay @MetaMask/wallet-ux -app/components/Views/QRScanner @MetaMask/wallet-ux -app/components/Views/Settings @MetaMask/wallet-ux -app/components/Views/TermsAndConditions @MetaMask/wallet-ux - -app/reducers/experimentalSettings @MetaMask/wallet-ux -app/reducers/modals @MetaMask/wallet-ux -app/reducers/navigation @MetaMask/wallet-ux -app/reducers/onboarding @MetaMask/wallet-ux -app/reducers/privacy @MetaMask/wallet-ux -app/reducers/settings @MetaMask/wallet-ux +app/components @MetaMask/wallet-ux +app/reducers/experimentalSettings @MetaMask/wallet-ux +app/reducers/modals @MetaMask/wallet-ux +app/reducers/navigation @MetaMask/wallet-ux +app/reducers/onboarding @MetaMask/wallet-ux +app/reducers/privacy @MetaMask/wallet-ux +app/reducers/settings @MetaMask/wallet-ux diff --git a/.github/workflows/add-release-label.yml b/.github/workflows/add-release-label.yml index 80941c645364..a5a4daa71037 100644 --- a/.github/workflows/add-release-label.yml +++ b/.github/workflows/add-release-label.yml @@ -30,7 +30,7 @@ jobs: id: get-next-semver-version env: FORCE_NEXT_SEMVER_VERSION: ${{ vars.FORCE_NEXT_SEMVER_VERSION }} - run: ./get-next-semver-version.sh "$FORCE_NEXT_SEMVER_VERSION" + run: ./scripts/get-next-semver-version.sh "$FORCE_NEXT_SEMVER_VERSION" working-directory: '.github/scripts' - name: Add release label to PR and linked issues diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 584e983f57cd..e1b92a4d58d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,18 @@ jobs: bundler-cache: true env: BUNDLE_GEMFILE: ios/Gemfile + - name: Determine whether the current PR is a draft + id: set-is-draft + if: github.event_name == 'pull_request' && github.event.pull_request.number + run: echo "IS_DRAFT=$(gh pr view --json isDraft --jq '.isDraft' "${PR_NUMBER}")" >> "$GITHUB_OUTPUT" + env: + PR_NUMBER: ${{ github.event.pull_request.number }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Setup registry config for using package previews on draft PRs + if: github.event_name == 'pull_request' && steps.set-is-draft.outputs.IS_DRAFT == 'true' + run: printf '%s\n\n%s' '@metamask:registry=https://npm.pkg.github.com' "//npm.pkg.github.com/:_authToken=${PACKAGE_READ_TOKEN}" > .npmrc + env: + PACKAGE_READ_TOKEN: ${{ secrets.PACKAGE_READ_TOKEN }} - run: yarn setup - name: Require clean working directory shell: bash @@ -167,14 +179,14 @@ jobs: with: name: ios-bundle path: ios/main.jsbundle - + ship-js-bundle-size-check: runs-on: ubuntu-latest needs: [js-bundle-size-check] if: ${{ github.ref == 'refs/heads/main' }} steps: - uses: actions/checkout@v4 - + - name: Download iOS bundle uses: actions/download-artifact@v4 with: diff --git a/.iyarc b/.iyarc index abbf0e189d26..7fb6e40287c9 100644 --- a/.iyarc +++ b/.iyarc @@ -1,3 +1,7 @@ # ReDoS vulnerability, no impact to this application, and fix not backported yet to the versions we use GHSA-c2qf-rxjj-qqgw + +# Sentry SDK Prototype Pollution gadget in JavaScript SDKs + +GHSA-593m-55hh-j8gv diff --git a/.storybook/storybook.requires.js b/.storybook/storybook.requires.js index a1ca7774ac88..31f1669fd928 100644 --- a/.storybook/storybook.requires.js +++ b/.storybook/storybook.requires.js @@ -123,10 +123,7 @@ const getStories = () => { "./app/component-library/base-components/TagBase/TagBase.stories.tsx": require("../app/component-library/base-components/TagBase/TagBase.stories.tsx"), "./app/component-library/components-temp/TagColored/TagColored.stories.tsx": require("../app/component-library/components-temp/TagColored/TagColored.stories.tsx"), "./app/component-library/components-temp/KeyValueRow/KeyValueRow.stories.tsx": require("../app/component-library/components-temp/KeyValueRow/KeyValueRow.stories.tsx"), - "./app/components/Views/confirmations/components/UI/InfoRow/InfoRow.stories.tsx": require("../app/components/Views/confirmations/components/UI/InfoRow/InfoRow.stories.tsx"), - "./app/components/Views/confirmations/components/UI/ExpandableSection/ExpandableSection.stories.tsx": require("../app/components/Views/confirmations/components/UI/ExpandableSection/ExpandableSection.stories.tsx"), - "./app/components/Views/confirmations/components/UI/Tooltip/Tooltip.stories.tsx": require("../app/components/Views/confirmations/components/UI/Tooltip/Tooltip.stories.tsx"), - "./app/components/Views/confirmations/components/UI/CopyButton/CopyButton.stories.tsx": require("../app/components/Views/confirmations/components/UI/CopyButton/CopyButton.stories.tsx"), + "./app/components/UI/InfoRow/InfoRow.stories.tsx": require("../app/components/UI/InfoRow/InfoRow.stories.tsx"), }; }; diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e992dae2817..1afbe7ca3335 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,114 @@ ## Current Main Branch -## 7.32.0 - Oct 7, 2024 +## 7.33.0 - Oct 3, 2024 +### Added +- [#11507](https://github.com/MetaMask/metamask-mobile/pull/11507): feat: 10550 Re-introduce test for measuring cold app start + JS bundle load time (#11507) +- [#11347](https://github.com/MetaMask/metamask-mobile/pull/11347): "chore: revert ""feat: react native fast crypto for notifications"" (#11347)" +- [#11318](https://github.com/MetaMask/metamask-mobile/pull/11318): feat: app event manager and attribution id parameters (#11318) +- [#11445](https://github.com/MetaMask/metamask-mobile/pull/11445): feat: add the abilty to hide the disconnect all button as well as showing and hiding the accounts row when necessary (#11445) +- [#11386](https://github.com/MetaMask/metamask-mobile/pull/11386): feat(3299): add tracking to network switching and confirmation (#11386) +- [#11379](https://github.com/MetaMask/metamask-mobile/pull/11379): refactor: rename the feature flag since it had a typo (#11379) +- [#11239](https://github.com/MetaMask/metamask-mobile/pull/11239): feat(2739): permission summary view gets the ability to disconnect all (#11239) +- [#11382](https://github.com/MetaMask/metamask-mobile/pull/11382): chore(runway): cherry-pick feat: app event manager and attribution id parameters (#11382) +- [#11497](https://github.com/MetaMask/metamask-mobile/pull/11497): feat: simple key-> value component for text value type (#11497) +- [#11478](https://github.com/MetaMask/metamask-mobile/pull/11478): feat: adding title to confirmation page (#11478) +- [#11477](https://github.com/MetaMask/metamask-mobile/pull/11477): feat: adding footer section to confirmation page (#11477) +- [#11454](https://github.com/MetaMask/metamask-mobile/pull/11454): feat: adding very basic confirmation page hidden behind env var (#11454) +- [#11083](https://github.com/MetaMask/metamask-mobile/pull/11083): feat: bundle size check (#11083) +- [#11452](https://github.com/MetaMask/metamask-mobile/pull/11452): feat(ds): add ListItem top and bottom accessories (#11452) +- [#11387](https://github.com/MetaMask/metamask-mobile/pull/11387): feat: 10550 Re-introduce test for measuring cold app start + JS bundle load time (#11387) +- [#11464](https://github.com/MetaMask/metamask-mobile/pull/11464): feat: STAKE-804: build pooled staking empty state component (#11464) +- [#11399](https://github.com/MetaMask/metamask-mobile/pull/11399): feat: add learn more modal component for staking (#11399) +- [#11261](https://github.com/MetaMask/metamask-mobile/pull/11261): feat: STAKE-822 build your balance component (#11261) +- [#11294](https://github.com/MetaMask/metamask-mobile/pull/11294): feat: added KeyValueRow to component-library/components-temp (#11294) +- [#11185](https://github.com/MetaMask/metamask-mobile/pull/11185): "feat: display ""Snaps (Beta)"" decorator tag in accounts list (#11185)" +- [#10829](https://github.com/MetaMask/metamask-mobile/pull/10829): feat: Eth snap keyring (#10829) +- [#11455](https://github.com/MetaMask/metamask-mobile/pull/11455): feat: bootstrap a reset notifications feat (#11455) +- [#11466](https://github.com/MetaMask/metamask-mobile/pull/11466): feat: add support for external links (#11466) +- [#11429](https://github.com/MetaMask/metamask-mobile/pull/11429): feat: add timeout handler (#11429) +- [#11427](https://github.com/MetaMask/metamask-mobile/pull/11427): feat: add feature announcements channel for android (#11427) +- [#11250](https://github.com/MetaMask/metamask-mobile/pull/11250): fix: push notifications (#11250) +- [#11069](https://github.com/MetaMask/metamask-mobile/pull/11069): feat: react native fast crypto for notifications (#11069) + +### Changed +- [#11615](https://github.com/MetaMask/metamask-mobile/pull/11615): chore: exclude temporarily sentry SDK advisory (#11615) +- [#11577](https://github.com/MetaMask/metamask-mobile/pull/11577): ci: disable swaps e2e workflow (#11577) +- [#11350](https://github.com/MetaMask/metamask-mobile/pull/11350): chore: replace Segment patch by plugin (#11350) +- [#11287](https://github.com/MetaMask/metamask-mobile/pull/11287): chore: remove unused events (#11287) +- [#11512](https://github.com/MetaMask/metamask-mobile/pull/11512): fix: android firebase docs template (#11512) +- [#11517](https://github.com/MetaMask/metamask-mobile/pull/11517): chore: delete swaps token charts test (#11517) +- [#11515](https://github.com/MetaMask/metamask-mobile/pull/11515): test: disable swaps token charts regression tests (#11515) +- [#11504](https://github.com/MetaMask/metamask-mobile/pull/11504): chore: revert measuring with react native performance (#11504) +- [#11458](https://github.com/MetaMask/metamask-mobile/pull/11458): test: Merge Import Token flow methods and ids in just one folder and files (#11458) +- [#11492](https://github.com/MetaMask/metamask-mobile/pull/11492): chore(revert): Prevent redundant Sentry sourcemap uploads (#11492) +- [#11469](https://github.com/MetaMask/metamask-mobile/pull/11469): test: Remove E2E Tests for Features No Longer Present in the App (#11469) +- [#11425](https://github.com/MetaMask/metamask-mobile/pull/11425): chore: Add skip label to bypass sonarcloud (#11425) +- [#11275](https://github.com/MetaMask/metamask-mobile/pull/11275): chore(js-ts): Convert app/util/bytes.js to TypeScript (#11275) +- [#11418](https://github.com/MetaMask/metamask-mobile/pull/11418): chore: revert chore(js-ts): Migrate 37 0-error js files (#11418) +- [#10880](https://github.com/MetaMask/metamask-mobile/pull/10880): chore: Enable linting Pods and re-organize setup.mjs file (#10880) +- [#11311](https://github.com/MetaMask/metamask-mobile/pull/11311): chore(js-ts): Convert app/components/UI/Swaps/components/Ratio.js to TypeScript (#11311) +- [#11357](https://github.com/MetaMask/metamask-mobile/pull/11357): chore(js-ts): Convert app/components/Views/PickComponent/index.js to TypeScript (#11357) +- [#11446](https://github.com/MetaMask/metamask-mobile/pull/11446): chore(js-ts): Convert app/components/Views/MediaPlayer/Loader.js to TypeScript (#11446) +- [#11473](https://github.com/MetaMask/metamask-mobile/pull/11473): chore(js-ts): Convert app/components/Base/ModalHandler.js to TypeScript (#11473) +- [#11601](https://github.com/MetaMask/metamask-mobile/pull/11601): chore(js-ts): Convert app/components/Base/ListItem.js to TypeScript (#11601) +- [#11407](https://github.com/MetaMask/metamask-mobile/pull/11407): chore(js-ts): Convert app/util/jsonRpcRequest.js to TypeScript (#11407) +- [#11594](https://github.com/MetaMask/metamask-mobile/pull/11594): chore(js-ts): Convert app/component-library/components/Icons/Icon/scripts/generate-assets.js to TypeScript (#11594) +- [#11523](https://github.com/MetaMask/metamask-mobile/pull/11523): chore(js-ts): Convert app/components/UI/GenericButton/index.ios.js to TypeScript (#11523) +- [#11472](https://github.com/MetaMask/metamask-mobile/pull/11472): chore(js-ts): Convert app/components/UI/FadeView/index.js to TypeScript (#11472) +- [#11476](https://github.com/MetaMask/metamask-mobile/pull/11476): chore(js-ts): Convert app/components/UI/OnboardingProgress/index.js to TypeScript (#11476) +- [#11405](https://github.com/MetaMask/metamask-mobile/pull/11405): chore(js-ts): Convert app/util/browserScripts.js to TypeScript (#11405) +- [#11214](https://github.com/MetaMask/metamask-mobile/pull/11214): chore(js-ts): Migrate 37 0-error js files (#11214) +- [#11271](https://github.com/MetaMask/metamask-mobile/pull/11271): chore(js-ts): Convert app/components/UI/ComponentErrorBoundary/index.js to TypeScript (#11271) +- [#11299](https://github.com/MetaMask/metamask-mobile/pull/11299): chore(js-ts): Convert app/util/validators/index.js to TypeScript (#11299) +- [#11303](https://github.com/MetaMask/metamask-mobile/pull/11303): chore(js-ts): Convert app/components/Base/SelectorButton.js to TypeScript (#11303) +- [#11280](https://github.com/MetaMask/metamask-mobile/pull/11280): chore(js-ts): Convert app/components/UI/GenericButton/index.android.js to TypeScript (#11280) +- [#11273](https://github.com/MetaMask/metamask-mobile/pull/11273): chore(js-ts): Convert app/components/UI/OnboardingScreenWithBg/index.js to TypeScript (#11273) +- [#11272](https://github.com/MetaMask/metamask-mobile/pull/11272): chore(js-ts): Convert app/components/Base/ModalDragger.js to TypeScript (#11272) +- [#11308](https://github.com/MetaMask/metamask-mobile/pull/11308): chore(js-ts): Convert app/components/UI/BlockingActionModal/index.js to TypeScript (#11308) +- [#11305](https://github.com/MetaMask/metamask-mobile/pull/11305): chore(js-ts): Convert app/components/Base/Summary.js to TypeScript (#11305) +- [#11274](https://github.com/MetaMask/metamask-mobile/pull/11274): chore(js-ts): Convert app/components/UI/ConnectHeader/index.js to TypeScript (#11274) +- [#11334](https://github.com/MetaMask/metamask-mobile/pull/11334): chore: chore/7.32.0-Changelog (#11334) +- [#11483](https://github.com/MetaMask/metamask-mobile/pull/11483): chore: refactor e2e (#11483) +- [#11491](https://github.com/MetaMask/metamask-mobile/pull/11491): chore: Add UX CodeOwners responsibilities (#11491) +- [#11364](https://github.com/MetaMask/metamask-mobile/pull/11364): refactor(1702-2): auto detect nft component (#11364) +- [#11363](https://github.com/MetaMask/metamask-mobile/pull/11363): refactor(1702-1): auto detect tokens component (#11363) +- [#11329](https://github.com/MetaMask/metamask-mobile/pull/11329): chore: Add `@MetaMask/metamask-assets` to `CODEOWNERS` (#11329) +- [#10449](https://github.com/MetaMask/metamask-mobile/pull/10449): chore: remove installation of redundant detox-cli in bitrise (#10449) +- [#11111](https://github.com/MetaMask/metamask-mobile/pull/11111): chore(deps): Bump `@metamask/phishing-controller` from `^9.0.0` to `^12.0.1` (#11111) +- [#11375](https://github.com/MetaMask/metamask-mobile/pull/11375): chore(deps): Bump `@metamask/controller-utils` from `^10.0.0` to `^11.3.0` (#11375) +- [#11140](https://github.com/MetaMask/metamask-mobile/pull/11140): chore(deps): Bump `@metamask/smart-transactions-controller` from `11.0.0` to `^13.0.0` (#11140) +- [#11351](https://github.com/MetaMask/metamask-mobile/pull/11351): chore(deps): Bump `@metamask/keyring-controller` from `^16.1.0` to `^17.2.1` (#11351) +- [#11104](https://github.com/MetaMask/metamask-mobile/pull/11104): chore(deps): Bump `@metamask/address-book-controller` from `^4.0.1` to `^6.0.1` (#11104) +- [#10917](https://github.com/MetaMask/metamask-mobile/pull/10917): chore(ci): split out ci scripts and devDeps into separate project (#10917) +- [#11081](https://github.com/MetaMask/metamask-mobile/pull/11081): chore: Prevent redundant Sentry sourcemap uploads (#11081) +- [#11430](https://github.com/MetaMask/metamask-mobile/pull/11430): fix: refactor Logger usage (#11430) +- [#11470](https://github.com/MetaMask/metamask-mobile/pull/11470): chore: [Design quality] Update token details (#11470) +- [#11439](https://github.com/MetaMask/metamask-mobile/pull/11439): "chore: cherry-pick fix: ""chore(deps): Bump @metamask/base-controller from ^6.0.0 to ^7.0.0 (#11207)"" (#11439)" +- [#11169](https://github.com/MetaMask/metamask-mobile/pull/11169): "chore(deps): Bump `@metamask/signature-controller` from `^17.0.0` to `^19.1.0` +- [#11352](https://github.com/MetaMask/metamask-mobile/pull/11352): "chore(deps): Bump `@metamask/accounts-controller` to `^18.2.1` +### Fixed +- [#11581](https://github.com/MetaMask/metamask-mobile/pull/11581): fix: Fix invalid browser url crash (#11581) +- [#11467](https://github.com/MetaMask/metamask-mobile/pull/11467): fix: Reorder prep_environment (#11467) +- [#11367](https://github.com/MetaMask/metamask-mobile/pull/11367): fix: Update steps of the methods that are no longer valid (#11367) +- [#11400](https://github.com/MetaMask/metamask-mobile/pull/11400): fix: Stop crowdin action from creating branches (#11400) +- [#11348](https://github.com/MetaMask/metamask-mobile/pull/11348): fix: splash screen image on android (#11348) +- [#11346](https://github.com/MetaMask/metamask-mobile/pull/11346): fix: splash screen image on android (#11346) +- [#11554](https://github.com/MetaMask/metamask-mobile/pull/11554): fix: Fix/use portfolio home page (#11554) +- [#11443](https://github.com/MetaMask/metamask-mobile/pull/11443): fix: react native quick crypto ios build bug (#11443) +- [#11325](https://github.com/MetaMask/metamask-mobile/pull/11325): fix: loader can display on top of login screen (#11325) +- [#11372](https://github.com/MetaMask/metamask-mobile/pull/11372): fix: origin spoofing vulnerability in signature prompts on iOS (#11372) +- [#11076](https://github.com/MetaMask/metamask-mobile/pull/11076): fix(2453): adjust UI details for account cell on wallet screen (#11076) +- [#11524](https://github.com/MetaMask/metamask-mobile/pull/11524): fix: fix duplicated network select (#11524) +- [#11411](https://github.com/MetaMask/metamask-mobile/pull/11411): fix: fix fixture builder network state (#11411) +- [#11380](https://github.com/MetaMask/metamask-mobile/pull/11380): fix: Unreadable Asset options (#11380) +- [#11321](https://github.com/MetaMask/metamask-mobile/pull/11321): fix: fix detect tokens performance (#11321) +- [#11401](https://github.com/MetaMask/metamask-mobile/pull/11401): fix: replace decomissioned cloudflare-ipfs.com with gateway.pinata.cloud (#11401) +- [#11552](https://github.com/MetaMask/metamask-mobile/pull/11552): fix(11481): android system alert respects dark mode themes (#11552) +- [#11518](https://github.com/MetaMask/metamask-mobile/pull/11518): fix(11482): incorrect QR code error (#11518) + +## 7.32.0 - Oct 7, 2024 ### Added - [#10294](https://github.com/MetaMask/metamask-mobile/pull/10294): feat: create redux slice for featureFlags (#10294) @@ -364,7 +470,10 @@ - [#10383](https://github.com/MetaMask/metamask-mobile/pull/10383): fix: race condition issues when doing batch-rpc calls in the DeeplinkProtocolService (#10383) - [#10365](https://github.com/MetaMask/metamask-mobile/pull/10365): fix: attribution link (#10365) - [#10303](https://github.com/MetaMask/metamask-mobile/pull/10303): fix: page navigation during QR accounts selection (#10303) +<<<<<<< HEAD +======= +>>>>>>> main ## 7.28.1 - Aug 15, 2024 ### Fixed - [#10637](https://github.com/MetaMask/metamask-mobile/pull/10637): fix: swap button blocked by SwapsController polling issue (#10637) diff --git a/android/app/build.gradle b/android/app/build.gradle index 80ffad8fa282..6a40a9f84ba1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -173,8 +173,8 @@ android { applicationId "io.metamask" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1450 - versionName "7.32.0" + versionName "7.33.0" + versionCode 1456 testBuildType System.getProperty('testBuildType', 'debug') missingDimensionStrategy 'react-native-camera', 'general' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -229,7 +229,7 @@ android { release { manifestPlaceholders.isDebug = false minifyEnabled enableProguardInReleaseBuilds - proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro", "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro", "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules.pro" + proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } diff --git a/app/actions/notification/constants/index.ts b/app/actions/notification/constants/index.ts index ee8c63fdffa7..c75c9eb00820 100644 --- a/app/actions/notification/constants/index.ts +++ b/app/actions/notification/constants/index.ts @@ -19,7 +19,6 @@ export enum notificationsErrors { UPDATE_TRIGGER_PUSH_NOTIFICATIONS = 'Error while trying to update trigger push notifications', ENABLE_NOTIFICATIONS_SERVICES = 'Error while trying to enable notifications services', DISABLE_NOTIFICATIONS_SERVICES = 'Error while trying to disable notifications services', - DELETE_STORAGE_KEY = 'Error while trying to delete storage key', } export default notificationsErrors; diff --git a/app/actions/notification/helpers/index.ts b/app/actions/notification/helpers/index.ts index 9f47da07f88e..0cd827ad3ef5 100644 --- a/app/actions/notification/helpers/index.ts +++ b/app/actions/notification/helpers/index.ts @@ -171,20 +171,3 @@ export const markMetamaskNotificationsAsRead = async ( return getErrorMessage(error); } }; -/** - * Perform the deletion of the notifications storage key and the creation of on chain triggers to reset the notifications. - * - * @returns {Promise} A promise that resolves to a string error message or undefined if successful. - */ -export const performDeleteStorage = async (): Promise => { - try { - await Engine.context.UserStorageController.performDeleteStorage('notifications.notification_settings'); - await Engine.context.NotificationServicesController.createOnChainTriggers( - { - resetNotifications: true, - }, - ); - } catch (error) { - return getErrorMessage(error); - } -}; diff --git a/app/actions/security/index.ts b/app/actions/security/index.ts index 661c1d1119d0..e0e87a0ef550 100644 --- a/app/actions/security/index.ts +++ b/app/actions/security/index.ts @@ -8,7 +8,6 @@ export enum ActionType { SET_AUTOMATIC_SECURITY_CHECKS_MODAL_OPEN = 'SET_AUTOMATIC_SECURITY_CHECKS_MODAL_OPEN', SET_DATA_COLLECTION_FOR_MARKETING = 'SET_DATA_COLLECTION_FOR_MARKETING', SET_NFT_AUTO_DETECTION_MODAL_OPEN = 'SET_NFT_AUTO_DETECTION_MODAL_OPEN', - SET_MULTI_RPC_MIGRATION_MODAL_OPEN = 'SET_MULTI_RPC_MIGRATION_MODAL_OPEN', } export interface AllowLoginWithRememberMeUpdated @@ -36,11 +35,6 @@ export interface SetNftAutoDetectionModalOpen open: boolean; } -export interface SetMultiRpcMigrationModalOpen - extends ReduxAction { - open: boolean; -} - export interface SetDataCollectionForMarketing extends ReduxAction { enabled: boolean; @@ -52,8 +46,7 @@ export type Action = | UserSelectedAutomaticSecurityChecksOptions | SetAutomaticSecurityChecksModalOpen | SetDataCollectionForMarketing - | SetNftAutoDetectionModalOpen - | SetMultiRpcMigrationModalOpen; + | SetNftAutoDetectionModalOpen; export const setAllowLoginWithRememberMe = ( enabled: boolean, @@ -89,13 +82,6 @@ export const setNftAutoDetectionModalOpen = ( open, }); -export const setMultiRpcMigrationModalOpen = ( - open: boolean, -): SetMultiRpcMigrationModalOpen => ({ - type: ActionType.SET_MULTI_RPC_MIGRATION_MODAL_OPEN, - open, -}); - export const setDataCollectionForMarketing = (enabled: boolean) => ({ type: ActionType.SET_DATA_COLLECTION_FOR_MARKETING, enabled, diff --git a/app/component-library/components-temp/CellSelectWithMenu/CellSelectWithMenu.tsx b/app/component-library/components-temp/CellSelectWithMenu/CellSelectWithMenu.tsx index e18ed0465956..ff8df60913ae 100644 --- a/app/component-library/components-temp/CellSelectWithMenu/CellSelectWithMenu.tsx +++ b/app/component-library/components-temp/CellSelectWithMenu/CellSelectWithMenu.tsx @@ -33,7 +33,6 @@ const CellSelectWithMenu = ({ tagLabel, isSelected = false, children, - withAvatar = true, ...props }: CellSelectWithMenuProps) => { const { styles } = useStyles(styleSheet, { style }); @@ -47,15 +46,12 @@ const CellSelectWithMenu = ({ > {/* DEV Note: Account Avatar should be replaced with Avatar with Badge whenever available */} - {withAvatar ? ( - - ) : null} - + @@ -14,10 +16,10 @@ exports[`CellSelectWithMenu should render with default settings correctly 1`] = disabled={false} style={ { - "flex": 1, "opacity": 1, "padding": 16, "position": "relative", + "width": "95%", "zIndex": 1, } } @@ -285,13 +287,7 @@ exports[`CellSelectWithMenu should render with default settings correctly 1`] = - + { +const KeyValueRowLabel = ({ + label, + variant = TextVariant.BodyMDMedium, + color = TextColor.Default, + tooltip, +}: KeyValueRowLabelProps) => { const { styles } = useStyles(styleSheet, {}); const { openTooltipModal } = useTooltipModal(); - const hasTooltip = tooltip?.title && tooltip?.content; + const hasTooltip = tooltip?.title && tooltip?.text; const onNavigateToTooltipModal = () => { if (!hasTooltip) return; - openTooltipModal(tooltip.title, tooltip.content); + openTooltipModal(tooltip.title, tooltip.text); }; return ( - {isPreDefinedKeyValueRowLabel(label) ? ( - - ) : ( - label - )} + {hasTooltip && ( )} diff --git a/app/component-library/components-temp/KeyValueRow/KeyValueRow.stories.tsx b/app/component-library/components-temp/KeyValueRow/KeyValueRow.stories.tsx index ee34ef3c4b43..e5a440b32763 100644 --- a/app/component-library/components-temp/KeyValueRow/KeyValueRow.stories.tsx +++ b/app/component-library/components-temp/KeyValueRow/KeyValueRow.stories.tsx @@ -8,7 +8,6 @@ import KeyValueRowComponent, { import Text, { TextColor, TextVariant } from '../../components/Texts/Text'; import Title from '../../../components/Base/Title'; import { IconColor, IconName, IconSize } from '../../components/Icons/Icon'; -import Button, { ButtonVariants } from '../../components/Buttons/Button'; const KeyValueRowMeta = { title: 'Components Temp / KeyValueRow', @@ -39,56 +38,42 @@ export const KeyValueRow = { - {/* Using Custom ReactNode */} - alert('test')} - /> - ), - }} - /> ), diff --git a/app/component-library/components-temp/KeyValueRow/KeyValueRow.test.tsx b/app/component-library/components-temp/KeyValueRow/KeyValueRow.test.tsx index 389a3213db5f..a9b00ece7e86 100644 --- a/app/component-library/components-temp/KeyValueRow/KeyValueRow.test.tsx +++ b/app/component-library/components-temp/KeyValueRow/KeyValueRow.test.tsx @@ -19,8 +19,8 @@ describe('KeyValueRow', () => { it('should render when there is only text', () => { const { toJSON } = render( , ); @@ -31,17 +31,17 @@ describe('KeyValueRow', () => { const { toJSON } = render( , @@ -54,13 +54,13 @@ describe('KeyValueRow', () => { const { toJSON } = render( { const { toJSON } = render( , diff --git a/app/component-library/components-temp/KeyValueRow/KeyValueRow.tsx b/app/component-library/components-temp/KeyValueRow/KeyValueRow.tsx index 212396f888e6..18c6300b1cfa 100644 --- a/app/component-library/components-temp/KeyValueRow/KeyValueRow.tsx +++ b/app/component-library/components-temp/KeyValueRow/KeyValueRow.tsx @@ -8,6 +8,7 @@ import { } from './KeyValueRow.types'; import Icon from '../../components/Icons/Icon'; import { View } from 'react-native'; +import { areKeyValueRowPropsEqual } from './KeyValueRow.utils'; import KeyValueSection from './KeyValueSection/KeyValueSection'; import KeyValueRowLabel from './KeyValueLabel/KeyValueLabel'; import KeyValueRowRoot from './KeyValueRoot/KeyValueRoot'; @@ -44,7 +45,12 @@ const KeyValueRow = React.memo(({ field, value, style }: KeyValueRowProps) => { (fieldIcon.side === KeyValueRowFieldIconSides.LEFT || fieldIcon.side === KeyValueRowFieldIconSides.BOTH || !fieldIcon?.side) && } - + {shouldShowFieldIcon && (fieldIcon?.side === KeyValueRowFieldIconSides.RIGHT || fieldIcon?.side === KeyValueRowFieldIconSides.BOTH) && ( @@ -58,7 +64,12 @@ const KeyValueRow = React.memo(({ field, value, style }: KeyValueRowProps) => { (valueIcon?.side === KeyValueRowFieldIconSides.LEFT || valueIcon?.side === KeyValueRowFieldIconSides.BOTH || !valueIcon?.side) && } - + {shouldShowValueIcon && (valueIcon?.side === KeyValueRowFieldIconSides.RIGHT || valueIcon?.side === KeyValueRowFieldIconSides.BOTH) && ( @@ -68,7 +79,7 @@ const KeyValueRow = React.memo(({ field, value, style }: KeyValueRowProps) => { ); -}); +}, areKeyValueRowPropsEqual); /** * Exported sub-components to provide a base for new KeyValueRow variants. diff --git a/app/component-library/components-temp/KeyValueRow/KeyValueRow.types.ts b/app/component-library/components-temp/KeyValueRow/KeyValueRow.types.ts index fc4e825921e4..0e9c864d3095 100644 --- a/app/component-library/components-temp/KeyValueRow/KeyValueRow.types.ts +++ b/app/component-library/components-temp/KeyValueRow/KeyValueRow.types.ts @@ -19,9 +19,9 @@ interface KeyValueRowTooltip { */ title: string; /** - * The content displayed within the tooltip body. + * The text displayed within the tooltip body. */ - content: string | ReactNode; + text: string; /** * Optional size of the tooltip icon. * @default TooltipSizes.Md @@ -47,9 +47,19 @@ export enum KeyValueRowFieldIconSides { */ interface KeyValueRowField { /** - * The label content displayed. + * The text to display. + */ + text: string; + /** + * Optional text variant. + * @default TextVariant.BodyMDMedium */ - label: PreDefinedKeyValueRowLabel | ReactNode; + variant?: TextProps['variant']; + /** + * Optional text color. + * @default TextColor.Default + */ + color?: TextProps['color']; /** * Optional icon to display. If undefined, no icon is displayed. */ @@ -64,11 +74,16 @@ export const IconSizes = IconSize; export const TooltipSizes = ButtonIconSizes; -export interface PreDefinedKeyValueRowLabel { +/** + * The KeyValueRowLabel prop interface. + * + * @see KeyValueRowLabel in ./KeyValueRow.tsx + */ +export interface KeyValueRowLabelProps { /** * Text to display. */ - text: string; + label: string; /** * Optional text variant. * @default TextVariant.BodyMDMedium @@ -79,18 +94,6 @@ export interface PreDefinedKeyValueRowLabel { * @default TextColor.Default */ color?: TextProps['color']; -} - -/** - * The KeyValueRowLabel prop interface. - * - * @see KeyValueRowLabel in ./KeyValueRow.tsx - */ -export interface KeyValueRowLabelProps { - /** - * The label content displayed. - */ - label: PreDefinedKeyValueRowLabel | ReactNode; /** * Optional tooltip. If undefined, the tooltip won't be displayed. */ diff --git a/app/component-library/components-temp/KeyValueRow/KeyValueRow.utils.ts b/app/component-library/components-temp/KeyValueRow/KeyValueRow.utils.ts index 3361cb4d66f5..bf4c38843e43 100644 --- a/app/component-library/components-temp/KeyValueRow/KeyValueRow.utils.ts +++ b/app/component-library/components-temp/KeyValueRow/KeyValueRow.utils.ts @@ -1,9 +1,8 @@ -import { - KeyValueRowLabelProps, - PreDefinedKeyValueRowLabel, -} from './KeyValueRow.types'; +import { KeyValueRowProps } from './KeyValueRow.types'; -export const isPreDefinedKeyValueRowLabel = ( - label: KeyValueRowLabelProps['label'], -): label is PreDefinedKeyValueRowLabel => - !!label && typeof label === 'object' && 'text' in label; +export const areKeyValueRowPropsEqual = ( + prevProps: KeyValueRowProps, + newProps: KeyValueRowProps, +) => + JSON.stringify(prevProps.field) === JSON.stringify(newProps.field) && + JSON.stringify(prevProps.value) === JSON.stringify(newProps.value); diff --git a/app/component-library/components-temp/KeyValueRow/__snapshots__/KeyValueRow.test.tsx.snap b/app/component-library/components-temp/KeyValueRow/__snapshots__/KeyValueRow.test.tsx.snap index a4c9e5f6bfef..c83d3a4fd5fa 100644 --- a/app/component-library/components-temp/KeyValueRow/__snapshots__/KeyValueRow.test.tsx.snap +++ b/app/component-library/components-temp/KeyValueRow/__snapshots__/KeyValueRow.test.tsx.snap @@ -201,7 +201,7 @@ exports[`KeyValueRow Prebuilt Component KeyValueRow should render text with icon Key Text { const { getByRole } = render( , @@ -66,9 +64,7 @@ describe('ListItemMultiSelectButton', () => { const { getByTestId } = render( , diff --git a/app/component-library/components-temp/ListItemMultiSelectButton/ListItemMultiSelectButton.tsx b/app/component-library/components-temp/ListItemMultiSelectButton/ListItemMultiSelectButton.tsx index a3cb0d079ffc..e8610e457352 100644 --- a/app/component-library/components-temp/ListItemMultiSelectButton/ListItemMultiSelectButton.tsx +++ b/app/component-library/components-temp/ListItemMultiSelectButton/ListItemMultiSelectButton.tsx @@ -20,12 +20,6 @@ import { IconColor, IconName, } from '../../../component-library/components/Icons/Icon'; -import Button, { - ButtonSize, - ButtonVariants, - ButtonWidthTypes, -} from '../../../component-library/components/Buttons/Button'; -import { TextVariant } from '../../../component-library/components/Texts/Text'; const ListItemMultiSelectButton: React.FC = ({ style, @@ -33,9 +27,7 @@ const ListItemMultiSelectButton: React.FC = ({ isDisabled = false, children, gap = DEFAULT_LISTITEMMULTISELECT_GAP, - showButtonIcon = true, buttonIcon = IconName.MoreVertical, - buttonProps, ...props }) => { const { styles } = useStyles(styleSheet, { @@ -63,29 +55,15 @@ const ListItemMultiSelectButton: React.FC = ({ )} - {showButtonIcon ? ( - - - - ) : null} - {buttonProps?.textButton ? ( - -