Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix: prevent bad svg urls in react-native-svg (#8102) #8134

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

chrisleewilcox
Copy link
Contributor

Description

Some dapps had bad icon urls in their metadata which prevented rendering favicon properly. This PR adds a patch to react-native-svg to prevent trying to render invalid svg urls.

Related issues

Fixes:
#1431

Manual testing steps

  1. In-app browser --> Go to https://btc20.com/
  2. Connect to dapp with WC
  3. Should not error

Screenshots/Recordings

WC connect to site with bad meta url

svg-wc.mp4

Search Bar icons

svg-search.mp4

Tab Bar icons

svg-tabs.mp4

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • 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 format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). 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.

Description

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • 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 format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). 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.

## **Description**
Some dapps had bad icon urls in their metadata which prevented rendering
favicon properly. This PR adds a patch to react-native-svg to prevent
trying to render invalid svg urls.

## **Related issues**

Fixes:
[#1431](https://app.zenhub.com/workspaces/metamask-mobile-5f984938ddc0e4001d4b79cb/issues/gh/metamask/mobile-planning/1431)

## **Manual testing steps**

1. In-app browser --> Go to [https://btc20.com/](https://btc20.com/)
2. Connect to dapp with WC
3. Should not error

## **Screenshots/Recordings**

### WC connect to site with bad meta url


https://github.com/MetaMask/metamask-mobile/assets/141057783/a1645016-6814-4be6-b027-d085856bad79

### Search Bar icons


https://github.com/MetaMask/metamask-mobile/assets/141057783/0328e3f3-7b60-440b-8667-72156c5667cc

### Tab Bar icons



https://github.com/MetaMask/metamask-mobile/assets/141057783/e1bc694b-68fe-417f-b493-97c6f066690f



## **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.

---------

Co-authored-by: Chris Wilcox <[email protected]>
@chrisleewilcox chrisleewilcox added team-mobile-client release-7.12.3 Issue or pull request that will be included in release 7.12.3 labels Dec 15, 2023
Copy link
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.

@chrisleewilcox chrisleewilcox changed the title fix: prevent bad svg urls in react-native-svg (#8102) chore: fix: prevent bad svg urls in react-native-svg (#8102) Dec 15, 2023
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

Lgtm

@Cal-L Cal-L marked this pull request as ready for review December 15, 2023 20:35
@Cal-L Cal-L requested a review from a team as a code owner December 15, 2023 20:35
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/dbb3786f-b020-4b76-b123-0ca42ece23e7
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (release/7.12.3@b4e5883). Click here to learn what that means.

Additional details and impacted files
@@                Coverage Diff                @@
##             release/7.12.3    #8134   +/-   ##
=================================================
  Coverage                  ?   37.38%           
=================================================
  Files                     ?     1052           
  Lines                     ?    28172           
  Branches                  ?     2517           
=================================================
  Hits                      ?    10533           
  Misses                    ?    17040           
  Partials                  ?      599           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Dec 15, 2023

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@chrisleewilcox chrisleewilcox added the regression-RC DEPRECATED: Please use "regresssion-RC-x.y.z" label instead label Dec 15, 2023
@metamaskbot metamaskbot added the type-bug Something isn't working label Dec 15, 2023
@chrisleewilcox chrisleewilcox added QA Passed A successful QA run through has been done and removed ready-for-dev labels Dec 15, 2023
@chrisleewilcox chrisleewilcox merged commit 007e524 into release/7.12.3 Dec 15, 2023
35 checks passed
@chrisleewilcox chrisleewilcox deleted the chore/cherry-pick-8102 branch December 15, 2023 21:15
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed A successful QA run through has been done regression-RC DEPRECATED: Please use "regresssion-RC-x.y.z" label instead release-7.12.3 Issue or pull request that will be included in release 7.12.3 team-mobile-platform type-bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants