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

[LL] - [LIVE-9593] - Fix networks not displaying for some tokens on receive and other screens #5184

Merged
merged 3 commits into from
Oct 25, 2023

Conversation

sshmaxime
Copy link
Contributor

@sshmaxime sshmaxime commented Oct 24, 2023

📝 Description

As of today, there is a discrepancy between the id returned by the APIs and the one we have in ledgerjs. The discrepancy comes from the fact that in ledgerjs library currencies id are not lowercase formatted. While waiting for that to be discussed this is a small fix to quick fix the current issue.

❓ Context

  • Impacted projects: LL
  • Linked resource(s): LIVE-9593

✅ Checklist

  • Test coverage
  • Atomic delivery
  • No breaking changes

📸 Demo

Before:

Screen.Recording.2023-10-24.at.17.14.09.mov

After:

Screen.Recording.2023-10-24.at.17.11.07.mov

🚀 Expectations to reach

Please make sure you follow these Important Steps.

Pull Requests must pass the CI and be internally validated in order to be merged.

@changeset-bot
Copy link

changeset-bot bot commented Oct 24, 2023

🦋 Changeset detected

Latest commit: b4b5bd3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@ledgerhq/live-common Patch
@ledgerhq/live-cli Patch
ledger-live-desktop Patch
live-mobile Patch
web-tools Patch
@ledgerhq/test-utils Patch
dummy-wallet-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Oct 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web-tools ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2023 9:43am
4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-docs ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2023 9:43am
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2023 9:43am
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2023 9:43am
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2023 9:43am

@live-github-bot live-github-bot bot added the common Has changes in live-common label Oct 24, 2023
@mcayuelas-ledger
Copy link
Contributor

Can you add a changeset ? :)

Copy link
Member

@KVNLS KVNLS left a comment

Choose a reason for hiding this comment

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

Does it make sense to do it above also?
assetsByLedgerId[asset.ledgerId.toLowerCase()] = asset;
That way we make sure we always compare lowercase strings, wdyt?

@@ -11,7 +11,7 @@ const groupCurrenciesByProvider = (
}
const assetsByProviderId: Record<string, CurrenciesByProviderId> = {};
for (const ledgerCurrency of currenciesSupported) {
const asset = assetsByLedgerId[ledgerCurrency.id];
const asset = assetsByLedgerId[ledgerCurrency.id.toLowerCase()];
if (asset) {
if (!assetsByProviderId[asset.providerId]) {
assetsByProviderId[asset.providerId] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

even there maybe also?

Copy link
Contributor Author

@sshmaxime sshmaxime Oct 25, 2023

Choose a reason for hiding this comment

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

@KVNLS @mcayuelas-ledger @cgrellard-ledger things coming out of getMappedAssets() are properly formatted (i.e lowercased) and coming from our APIs. It's unnecessary to lowercase it, we could do it for the sake of it, but I think it would be a stretch. That being said I can do it if one of you think it's worth it, let me know

Besides that I'm currently talking with the backend team to unify and agree on specific types of string for such things, to be continued ...

Copy link
Member

Choose a reason for hiding this comment

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

At least we will be resilient for changes, if they decide to upperCase tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done @KVNLS

Copy link
Member

@KVNLS KVNLS left a comment

Choose a reason for hiding this comment

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

🎉

@sshmaxime sshmaxime merged commit ff8738d into develop Oct 25, 2023
55 of 56 checks passed
@sshmaxime sshmaxime deleted the bugfix/LIVE-9593 branch October 25, 2023 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Has changes in live-common
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants