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: 1273 duplicate contact addresses #7482

Merged
merged 15 commits into from
Oct 23, 2023

Conversation

frankvonhoven
Copy link
Contributor

@frankvonhoven frankvonhoven commented Oct 12, 2023

Description

  • Adds a warning icon to contact addresses that are associated with more than 1 chainId (ambiguous)
  • Tapping icon opens bottom sheet with info that the address is associated to more than one chain
  • When selecting an ambiguous address in the Send To flow, an analytics event is fired

Related issues

_Fixes #1273

E2E Tests

✅ Pass: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/df69caa4-66f3-44cd-ad41-a097a6491ed7

Manual testing steps

  1. Install v7.6 of the app - checkout release/7.6.0 branch
  2. Add Ethereum classic via chainlist.org
  3. Add a contact on Mainnet
  4. Switch to Ethereum classic
  5. Notice that the same added contact shows on ethereum classic chain
  6. Checkout this branch.
  7. The app at this point should be able to identify ambiguous addresses and display a warning icon in the contacts list for:
    a. Settings > Contacts
    b. Send To --> Contacts
  8. In the send to flow:
    a. If an ambiguous address is selected, you should see a warning message on the Send To screen

Screenshots/Recordings

Contacts Ambiguous Addresses

Contacts.Ambiguous.mp4

Dark Mode

Screenshot 2023-10-18 at 10 14 05 AM

Send To Ambiguous Addresses

SelectAmbiguous.mp4

Dark Mode

Screenshot 2023-10-18 at 10 14 16 AM

Select Ambiguous Addresses to Send To

Send.To.Ambiguous.mp4

Warning Dark Mode

Screenshot 2023-10-18 at 10 14 26 AM

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained:
    • What problem this PR is solving.
    • How this problem was solved.
    • How reviewers can test my changes.
  • I’ve indicated what issue this PR is linked to: Fixes #???
  • I’ve included tests if applicable.
  • I’ve documented any added code.
  • I’ve applied the right labels on the PR (see labeling guidelines).
  • 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.

@github-actions
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.

@frankvonhoven frankvonhoven changed the title Fix/1273 duplicate contact addresses fix: 1273 duplicate contact addresses Oct 12, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 12, 2023

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (c31c17d) 34.72% compared to head (f614e51) 34.72%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7482      +/-   ##
==========================================
- Coverage   34.72%   34.72%   -0.01%     
==========================================
  Files        1020     1022       +2     
  Lines       27252    27279      +27     
  Branches     2229     2232       +3     
==========================================
+ Hits         9463     9472       +9     
- Misses      17292    17309      +17     
- Partials      497      498       +1     
Files Coverage Δ
app/components/Nav/App/index.js 5.83% <ø> (ø)
...s/SendFlow/AddressElement/AddressElement.styles.ts 100.00% <ø> (ø)
app/components/Views/SendFlow/SendTo/styles.ts 50.00% <ø> (ø)
...components/Views/SendFlow/WarningMessage/index.tsx 40.00% <100.00%> (ø)
...iguousAddressSheet/AmbiguousAddressSheet.styles.ts 100.00% <100.00%> (ø)
app/constants/navigation/Routes.ts 100.00% <ø> (ø)
app/core/Analytics/MetaMetrics.events.ts 100.00% <ø> (ø)
...s/Views/SendFlow/AddressElement/AddressElement.tsx 77.77% <0.00%> (-4.58%) ⬇️
...ts/AmbiguousAddressSheet/AmbiguousAddressSheet.tsx 85.71% <85.71%> (ø)
...ponents/Views/SendFlow/AddressList/AddressList.tsx 51.85% <50.00%> (-0.78%) ⬇️
... and 2 more

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

@frankvonhoven frankvonhoven added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) team-mobile-client labels Oct 12, 2023
@frankvonhoven frankvonhoven marked this pull request as ready for review October 12, 2023 20:38
@frankvonhoven frankvonhoven requested a review from a team as a code owner October 12, 2023 20:38
Copy link
Contributor

@tommasini tommasini left a comment

Choose a reason for hiding this comment

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

Hey @frankvonhoven amazing work!

Left some comment, let me know your thoughts!!

Also, it seems that it is some UI issues on the warning on the SendTo screen? Comparatively to the other, at least doesn't seem right the margin between the two warnings for me
image

@frankvonhoven
Copy link
Contributor Author

re: the warning message spacing... I did notice that but didn't know if it would be a real use case, since a user probably wouldn't want to send funds without having any funds. But perhaps I could refactor the warning component to only have a top margin?

@cortisiko
Copy link
Member

cortisiko commented Oct 17, 2023

@frankvonhoven can you test this in dark mode as well? The caution icons look a bit dark and it would be interesting to see if it is visible in dark mode.

Can you confirm that the translations are in for this feature? Confirm by showing recordings of the translated text for the new this is a ambitious address sheet

In terms of analytics, can you confirm that the analytic events are appearing correctly?

@frankvonhoven
Copy link
Contributor Author

@cortisiko

  • The caution icons in dark mode.
    A: Updated screenshots in PR description

  • Translations in for this feature
    A: Translations completed

    • Waiting on confirmation for translation integration into main
  • Analytic events appearing correctly

    • image

@frankvonhoven
Copy link
Contributor Author

@cortisiko with translations in I checked the modal in German and copied the string 3x to test long translations:
Screenshot 2023-10-19 at 6 13 46 PM

@frankvonhoven
Copy link
Contributor Author

@tommasini I fixed the padding for the warning component
Simulator Screen Shot - iPhone 14 - 2023-10-20 at 13 25 04

@sonarcloud
Copy link

sonarcloud bot commented Oct 20, 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 7 Code Smells

29.5% 29.5% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@sethkfman sethkfman 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
Contributor

@tommasini tommasini left a comment

Choose a reason for hiding this comment

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

LGTM!

@frankvonhoven frankvonhoven merged commit 9715076 into main Oct 23, 2023
25 of 26 checks passed
@frankvonhoven frankvonhoven deleted the fix/1273-duplicate-contact-addresses branch October 23, 2023 20:59
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Oct 23, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2023
@metamaskbot metamaskbot added the release-7.11.0 Issue or pull request that will be included in release 7.11.0 label Oct 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.11.0 Issue or pull request that will be included in release 7.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants