Skip to content

fix: patch for token rates controller with new price api endpoint#7957

Closed
tommasini wants to merge 8 commits intomainfrom
update/change-price-api-v2
Closed

fix: patch for token rates controller with new price api endpoint#7957
tommasini wants to merge 8 commits intomainfrom
update/change-price-api-v2

Conversation

@tommasini
Copy link
Copy Markdown
Contributor

@tommasini tommasini commented Nov 30, 2023

Description

Patch for update to new price api the fetch the token rates to deprecate the coin gecko endpoint

  • Patch TokenRatesController of assets-controlllers v10
  • Changed to PriceAPI
  • Improved the number of requests made by network change/account change
  • Increased pooling to 30 minutes
  • Implemented vsCurrencies and chain id supported by the Price API
  • Decreased the number of requested being made by TokenRatesController by hardcoding supported lists of priceAPI

Branch on core that it's easier to read the compiled code on the patch

Related issues

Fixes: #

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

This recording shows as well the number of fetches being made on different states of the app.
https://recordit.co/7zfxfz9esB

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.

@tommasini tommasini added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) team-mobile-client team-wallet-framework-deprecated DEPRECATED: please use "team-core-platform" instead labels Nov 30, 2023
@tommasini tommasini requested a review from a team as a code owner November 30, 2023 11:55
@github-actions
Copy link
Copy Markdown
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.

@metamaskbot metamaskbot added in-progress and removed needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Nov 30, 2023
@github-actions
Copy link
Copy Markdown
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/51125aa2-b748-49b3-9bb7-42c7980a9e5b
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (78988bc) 36.70% compared to head (56b8b83) 36.60%.
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7957      +/-   ##
==========================================
- Coverage   36.70%   36.60%   -0.11%     
==========================================
  Files        1074     1092      +18     
  Lines       28930    29177     +247     
  Branches     2630     2678      +48     
==========================================
+ Hits        10620    10680      +60     
- Misses      17712    17885     +173     
- Partials      598      612      +14     

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

@tommasini tommasini mentioned this pull request Nov 30, 2023
13 tasks
@tommasini
Copy link
Copy Markdown
Contributor Author

tommasini commented Nov 30, 2023

E2E failling but manually can't replicate: https://recordit.co/rzf3OWRlpb

Searching the token can't find XRP
image

Checked on last version of testflight as well

Failling on main as well
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/115f74f2-27fc-4372-aed7-7478b34725d5

MarioAslau
MarioAslau previously approved these changes Nov 30, 2023
@Gudahtt
Copy link
Copy Markdown
Member

Gudahtt commented Nov 30, 2023

The duplicate calls are concerning 🤔 maybe we need to bring in a few more changes from upstream, that should be fixed there.

We'll also want to strongly consider adjusting the polling interval before switching to this API, to reduce traffic volume

Copy link
Copy Markdown
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

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

Update patch notes to explain the changes.

…at token rates controller its called between events
… undefined because of the networl controller version being outdated
@cortisiko
Copy link
Copy Markdown
Member

E2E failling but manually can't replicate: https://recordit.co/rzf3OWRlpb

Searching the token can't find XRP image

Checked on last version of testflight as well

Failling on main as well https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/115f74f2-27fc-4372-aed7-7478b34725d5

@tommasini this was fixed. Pull in the latest main

@tommasini
Copy link
Copy Markdown
Contributor Author

@metamaskbot metamaskbot added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) and removed in-progress labels Dec 1, 2023
+ 1284: 'moonbeam',
+ 1285: 'moonriver',
+ 8453: 'base',
+ 8545: 'shiden network',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @tommasini! I'm working on copying these changes over to TokenRatesController in the core monorepo. I was cross-referencing this list with https://chainid.network, and it seems that this chain ID should be 336 (there doesn't seem to be a 8545). What are your thoughts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry for taking so long to answer @mcmire

We should talk about this, because this list is from our api team!
Amazing catch by the way!

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Dec 1, 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

@tommasini
Copy link
Copy Markdown
Contributor Author

I will let this PR open for reference but when our internal endpoint it's ready I will recreate it for not spend time with the conflicts, with this being said I will turn it into a draft for now

@tommasini tommasini marked this pull request as draft December 6, 2023 19:16
@metamaskbot metamaskbot added needs-qa Any New Features that needs a full manual QA prior to being added to a release. and removed needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Dec 18, 2023
@metamaskbot metamaskbot added blocked and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Jan 5, 2024
@tommasini
Copy link
Copy Markdown
Contributor Author

Closing this draft since this is already shipped

@tommasini tommasini closed this Jan 5, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2024
@gauthierpetetin gauthierpetetin added the team-mobile-platform Mobile Platform team label Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

blocked team-mobile-platform Mobile Platform team team-wallet-framework-deprecated DEPRECATED: please use "team-core-platform" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants