-
Notifications
You must be signed in to change notification settings - Fork 327
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
Bugfix/live 8698 Manager API v2 breaking changes adaptations #4896
Bugfix/live 8698 Manager API v2 breaking changes adaptations #4896
Conversation
🦋 Changeset detectedLatest commit: b8806a4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
5 Ignored Deployments
|
1f3726d
to
e8b8d9a
Compare
e1b4f30
to
3bd5f99
Compare
4cbb1c1
to
9f3275a
Compare
e6773aa
to
0c9f64d
Compare
8a383d9
to
09fa47f
Compare
09fa47f
to
cf8f707
Compare
apps/ledger-live-mobile/src/screens/Manager/AppsInstallUninstallWithDependenciesContext.ts
Outdated
Show resolved
Hide resolved
apps/ledger-live-mobile/src/screens/Manager/AppsInstallUninstallWithDependenciesContext.ts
Show resolved
Hide resolved
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.
Great work ! Thx for all the refactoring ! 🦖
c5ee7a4
to
b8806a4
Compare
📝 Description
Some breaking changes have been introduced on the Manager API v2 (in staging so far).
Today we are using v1 of the API unless a feature flag
listAppsV2
is enabled, but we should still handle those breaking changes anyway because using the v2 API brings a big network optimisation and we should aim to activate the flag soon.Changes in the Manager v2 API (backend)
/api/v2/apps/hash
: now outputs the apps in the same order as the input which makes it easier for us to use./api/v2/apps/hash
: now can return some apps asnull
if the hash does not match any appChanges in LL (this PR):
listAppsV2minor1
is introduced in order to not activate the old one by mistake which would break old versions of LL.currencyId
from the backend was never taken so in some cases ("Binance Chain" or "Persistence") there would be no associated currency, so in the My Ledger list of apps there would be a different icon, no ticker ("Persistence (XPRT)" with "(XPRT)" being the ticker), and no associated market cap, so the app would be at the bottom of the list when the "ranking by market cap" option is chosen.currencyId
from the backend is taken by default and if it doesn't exist, it is polyfilled with the same logic as in list apps v1 (matching app's name and acurrency
'scurrency.name
orcurrency.managerName
.InstalledAppsModal
. For instance with Ethereum and Polygon installed, if you open theInstalledAppsModal
listing all the installed apps, it would be impossible to uninstall Ethereum from there because the drawerUninstallDependenciesModal
would be blocked by the currently opened modal (InstalledAppsModal
).InstalledAppsModal
was not using aQueuedDrawer
, and alsoUninstallDependenciesModal
should use theisForcingToBeOpened
prop ofQueuedDrawer
. This is actually unrelated to listAppsV2 but it was noticed by QA so I fixed it here 🤷♂️ .setAppInstallWithDependencies
/setAppUninstallWithDependencies
with a simpleReact.Context
.InstalledAppDependenciesModal
andUninstallAppDependenciesModal
to have no business logic insideinstallAppFirstTime
tosetHasInstalledAnyApp
for more clarityMore context:
As a reminder this is the original work from Juan with more details about the optimisation in the PR description: #3097
And as an example of the optimisation, here's a before/after of networking when opening the manager on LLD:
before:
after:
What I tested:
MANAGER_API_BASE=https://manager.api.live.stg.ledger-test.com/api /Applications/Ledger\ Live\ Beta.app/Contents/MacOS/Ledger\ Live\ Beta
listAppsV2minor1
feature flag/api/hash
returns null for it, which would break on adevelop
build), tron)listAppsV2minor1
feature flagMANAGER_API_BASE=https://manager.api.live.stg.ledger-test.com/api
in debug settings/api/hash
returns null for it, which would break on adevelop
build), tron)❓ Context
lld, llm, common, types-live
✅ Checklist
📸 Demo
🚀 Expectations to reach
How to test ?
listAppsV2minor1
must be enabledMANAGER_API_BASE=https://manager.api.live.stg.ledger-test.com/api
MANAGER_API_BASE=http://appstore.api.aws.stg.ldg-tech.com/api
BYPASS_CORS=1
MANAGER_API_BASE=https://manager.api.live.ledger.com/api
Please make sure you follow these Important Steps.
Pull Requests must pass the CI and be internally validated in order to be merged.