-
Notifications
You must be signed in to change notification settings - Fork 354
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
feat: fix logic and refactor app install #8401
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done the QA for swaps no issue ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need applied the same change for FUND.
If we can merge today, tomorrow you need to deliver a new exchangeSDK version (patch) and send it to Mercuryo and Moonpay.
const shouldAddEthApp = | ||
(mainFromAccount.currency.family === "evm" || mainToAccount.currency.family === "evm") && | ||
mainFromAccount.currency.managerAppName !== "Ethereum" && | ||
mainToAccount.currency.managerAppName !== "Ethereum"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you removed a recent fix I did here, any reason we removed it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello. Yes, I have removed that and just added this part:
dependencies.push({ appName: mainFromAccount?.currency?.managerAppName });
It makes the code easier to read, and adds any app as needed. @CremaFR tested it for swaps, and it works well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but we need to keep the above logic to add ethereum in case of avax as it's needed for swap
And instead of doing a specific logic for only one coin we do a semi-generic thing here to add ethereum in the deps for evm families
https://ledgerhq.atlassian.net/browse/LIVE-14666
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a comment next time to explain such changes? This was incredibly obscure, and no one could have guessed it without context.
Even just linking the JIRA ticket would have been enough, as we often do for similar quirks in swaps https://github.com/LedgerHQ/ledger-live/blob/develop/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/index.tsx#L388
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or put in a function like addAvaxAppDep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I'll make a PR to add PTX owner of this file too from now on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sure, the name of the variable and the logic was not that hard to follow IMO and I understand that you probably wanted to remove this but if something is obscure or doesn't make sense I usually find the author of the change and try to get answers before doing a change if none are provided in the source code
I'll keep this in mind if I end up in a similar situation, as I usually add context if needed for strange changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, could’ve reached out first. Now that I know about managerAppName
not being reliable for swap, it makes sense.
but seeing appManagerName
to use directly instead of getting accounts like
const dependencies: AppRequest["dependencies"] = [
{
account: mainFromAccount,
},
{
account: mainToAccount,
},
];
I assume your fix was an issue with accounts not installing correct apps and you just didn't refacto the thing, and that we should just have used managerAppName
directly...
anyway invited you to #ptx-pr-review , it's the kind of changes I like to follow and know about 😹
fa11bae
…upport-app-install
…support-app-install
…upport-app-install
1fbfcc9
…upport-app-install
✅ Checklist
npx changeset
was attached.📝 Description
We had an issue where if the app was not installed the sell/card would crash. This PR fixes it.
Also, i have refactored the logic a little.
❓ Context
Ticket
🧐 Checklist for the PR Reviewers