How to improve loading account data: balances, names, and other assets #5886
Replies: 7 comments 1 reply
-
@kyranjamie @alter-eggo I'd be curious to get your immediate thoughts on the above proposal. Should we turn this into a discussion rather than an issue? It may affect how we structure mobile in particular. |
Beta Was this translation helpful? Give feedback.
-
This issue describes a solution, rather than a problem. What problem are we trying to solve here? Account data loading faster? |
Beta Was this translation helpful? Give feedback.
-
Yea, I understand the problem for power users is that they have to wait a long time when they try certain operations that require the loading of lots of data (specifically the accounts picker). So @314159265359879 is thinking perhaps we can resolve that wait by preloading the data before they make those operations. |
Beta Was this translation helpful? Give feedback.
-
While I'm sure there's more we can do to improve the efficiency of our requests, I'm not sold on this being the best solution. Requesting additional data during idle time is a legitimate technique, for example it's used to load JS bundles to improve app load performance in Angular. But, unlike JS files, the data discussed here goes stale. That means that, in many cases, we'll load data unnecessarily and by the time the user wants to see it, it'll be stale and need refetching again. Especially on mobile, this is expensive as you're asking the phone to perform battery-draining actions just in case advance users might want to see it. We already optimise by only loading what's in view, and this goes against that principal. I don't want to go back to requesting 300 account balances at one time. Further, identifying when the app is idle isn't necessarily easy. Maybe we detect the app's idle, but then the user does something, and their experience is degraded because we have so many requests in flight. The balance doesn't have to have loaded to select the account, so account data loading isn't blocking. If account balances are slow to load, let's cache longer, and increase the stale time as it's probably okay on most occasions. I welcome the idea, though recommend we begin by identifying the core problem, rather than suggesting a solution up front. |
Beta Was this translation helpful? Give feedback.
-
I think this is the core problem I see |
Beta Was this translation helpful? Give feedback.
-
Let's convert this to a discussion? @pete-watters raised a similar question re: querying across accounts recently in Slack |
Beta Was this translation helpful? Give feedback.
-
Thanks for moving this @314159265359879 . I opened another discussion about the broader concept of data provision here. Once we improve on that we can apply the best solution across all platforms and will keep this discussion in mind when doing that. |
Beta Was this translation helpful? Give feedback.
-
This is the core problem I see
I see the wallet loading assets and balances over and over again all the time even when there have been no changes since the last time I looked at the account.
It seems inefficient regardless of if there is a power user behind Leather or not. I think overall the wallet would benefit from more data persistence and loading based on changes rather than starting over and fetching everything: all Stacks NFT's and Ordinals etc. again.
Some of this is happening as you switch between accounts, on the select account screen. But it also happens when you remain in the same account. I would love to see a robust and lasting solution for this. Originally I wrote this up as a solution but agree that a more general discussion on how to handle this is a better.
Beta Was this translation helpful? Give feedback.
All reactions