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

fix: adjust the apiLogoUrl logic to handles cases when icon is an object with uri key #7917

Merged

Conversation

omridan159
Copy link
Contributor

@omridan159 omridan159 commented Nov 23, 2023

Description

Adjust the apiLogoUrl logic to handles cases when icon is an object with uri key

Related issues

Fixes: #

Manual testing steps

  1. Tested using the https://metamask.github.io/test-dapp/ with connect and personal sign operation

Screenshots/Recordings

Before

After

Screen.Recording.2023-11-23.at.14.22.22.mov

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.

@omridan159 omridan159 requested a review from a team as a code owner November 23, 2023 12:19
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.

abretonc7s
abretonc7s previously approved these changes Nov 23, 2023
@omridan159 omridan159 added the needs-qa Any New Features that needs a full manual QA prior to being added to a release. label Nov 23, 2023
@christopherferreira9 christopherferreira9 added QA in Progress QA has started on the feature. and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Nov 23, 2023
@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (69c79df) 37.39% compared to head (5ffadc7) 37.39%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7917   +/-   ##
=======================================
  Coverage   37.39%   37.39%           
=======================================
  Files        1052     1052           
  Lines       28175    28175           
  Branches     2517     2517           
=======================================
  Hits        10536    10536           
  Misses      17040    17040           
  Partials      599      599           

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

abretonc7s
abretonc7s previously approved these changes Nov 23, 2023
@Gudahtt
Copy link
Member

Gudahtt commented Nov 23, 2023

This seems to be related to #7920

Reminder to describe the purpose of the change in the PR title/description, not just what has changed. I didn't realize this was related to fixing a crash at first. See here for more about that: https://github.com/MetaMask/contributor-docs/blob/main/docs/pull-requests.md#use-the-description-to-explain-the-need-and-solution

Copy link

sonarcloud bot commented Nov 24, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@christopherferreira9
Copy link
Contributor

Fixed for both Android and iOS

@christopherferreira9 christopherferreira9 merged commit 54f3754 into main Nov 24, 2023
26 checks passed
@christopherferreira9 christopherferreira9 deleted the fix_apiLogoUrl-icon-cause-test-dapp-to-crash branch November 24, 2023 12:24
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2023
@metamaskbot metamaskbot added the release-7.13.0 Issue or pull request that will be included in release 7.13.0 label Nov 24, 2023
@Gudahtt Gudahtt linked an issue Nov 24, 2023 that may be closed by this pull request
@@ -62,7 +62,7 @@ class WebsiteIcon extends PureComponent {
/**
* Icon image to use, this substitutes getting the icon from the url
*/
icon: PropTypes.string,
icon: PropTypes.oneOfType([PropTypes.string | PropTypes.object]),
Copy link
Member

Choose a reason for hiding this comment

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

This is wrong, this is returning a number as a bitwise operation result.

Copy link
Member

Choose a reason for hiding this comment

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

The expected parameter is an array of PropTypes type properties

Suggested change
icon: PropTypes.oneOfType([PropTypes.string | PropTypes.object]),
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),

Copy link
Member

Choose a reason for hiding this comment

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

fixed in #7953

@christopherferreira9 christopherferreira9 added QA Passed A successful QA run through has been done and removed QA in Progress QA has started on the feature. labels Dec 14, 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 release-7.13.0 Issue or pull request that will be included in release 7.13.0 team-sdk SDK team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Crash when signing message
7 participants