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: improve SVG Validation and Error Handling in AvatarFavicon Component #9023

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

omridan159
Copy link
Contributor

@omridan159 omridan159 commented Mar 21, 2024

Description

This PR enhances the AvatarFavicon component by implementing an SVG validation step using a HEAD request to ensure URIs point to valid SVG files. It improves error handling by setting up a reliable fallback mechanism that activates if the SVG fails to load or doesn't pass validation. The introduction of state management for SVG source validation ensures that only verified SVGs are rendered, thereby minimizing potential rendering issues and improving overall component stability. This streamlined approach enhances user experience by providing a more resilient and error-tolerant AvatarFavicon component.

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Screen.Recording.2024-03-21.at.14.53.59.mov
Screen.Recording.2024-03-21.at.14.53.10.mov

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.

@omridan159 omridan159 requested review from a team as code owners March 21, 2024 15:01
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.

andreahaku
andreahaku previously approved these changes Mar 21, 2024
Copy link
Member

@andreahaku andreahaku left a comment

Choose a reason for hiding this comment

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

LGTM

@omridan159 omridan159 added needs-qa Any New Features that needs a full manual QA prior to being added to a release. team-sdk SDK team labels Mar 21, 2024
@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 Mar 21, 2024
Copy link
Member

@andreahaku andreahaku left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

sonarcloud bot commented Mar 21, 2024

@christopherferreira9
Copy link
Contributor

Looks good for QA.
Test cases:

  • Test connection and check connection list for SDK
  • Test connection and check connection list for WalletConnect

@christopherferreira9 christopherferreira9 added QA Passed A successful QA run through has been done Run Smoke E2E Triggers smoke e2e on Bitrise and removed QA in Progress QA has started on the feature. labels Mar 21, 2024
Copy link
Contributor

github-actions bot commented Mar 21, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: b236280
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/5c280c48-aa52-4bb2-8523-793a8556f29b

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@christopherferreira9 christopherferreira9 merged commit 55a03f3 into main Mar 21, 2024
37 checks passed
@christopherferreira9 christopherferreira9 deleted the fix_broken-svg-error-in-AvatarFavicon branch March 21, 2024 17:39
@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2024
@metamaskbot metamaskbot added release-7.20.0 Issue or pull request that will be included in release 7.20.0 release-7.19.0 Issue or pull request that will be included in release 7.19.0 and removed release-7.20.0 Issue or pull request that will be included in release 7.20.0 labels Mar 21, 2024
@metamaskbot
Copy link
Collaborator

Missing release label release-7.19.0 on PR. Adding release label release-7.19.0 on PR and removing other release labels(release-7.20.0), as PR was cherry-picked in branch 7.19.0.

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.19.0 Issue or pull request that will be included in release 7.19.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-sdk SDK team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants