-
Notifications
You must be signed in to change notification settings - Fork 148
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
Throttle queries when viewing many accounts for selection #4926
Comments
@mica000 Could you indicate a simple solution for how to display placeholders for balances and account label values (i.e. BNS names) in the scenario in which we can't load them for over 1+ more minutes given the user has been rate limited by the API? I imagine for the account label, we'd simply show "Account 1, 2, etc." and for the balances something like "–" instead of the value? We can improve our loading state UX in general for this component as part of our accounts UX redesign project, so this particular issue is meant to be a short-term solution as we roll out throttling to prevent errors related to lower rate limits from Hiro. |
@markmhendrickson my initial thought would be to have a ghost state added the to the InteractiveItem. Wdyt? If so, I can add the state to the designs and we just need to add this state to the same component on Storybook. Bonus point to being able to use the same behavior in all other places were we use the component |
@mica000 in this case, the row is still interactive, but only the money values are unknown. I don't think we should change InteractiveItem, because then we are extending the scope of the base component, for one specific instance. Asked chatgpt for help explaining difference between a component, and an instance of a component.
Using same analogy, we shouldn't change the blueprint for all houses, just to solve a problem specific to one house. |
Would the ghost state apply to just the balances part of the item rather than the item in its entirety? Because we'd want the user to be able to view and select each account item even if the remaining label and balance data hasn't loaded yet. |
Can we just remove the balances entirely? They consume a huge number of requests and cause 429 issues. What other information could we display to help users identify accounts? |
I was thinking here @mica000 was meaning to provide a 'loading' state for the data passed into the |
@kyranjamie What I meant was the opposite. The ghost state would be a state in any InteractiveItem before data is fetched. In doing so we would be able to use in all the other places, like Approval, Activity, Home etc.. Maybe a better term is LAZY LOADING? |
|
I wasn't going to this extend in how we would build in the FE. The proposal is mostly on how the component would work visually but that could be a good direction! |
@mica000 I think the confusion might be when you ref the state of You can see here in the I think if we want to share a |
I'd prefer to avoid removing entirely unless we can't come up with a better solution here since the information is quite important for distinguishing and identifying accounts. |
Agree. Im not aware of any other element we could use to identify accounts besides the amount, specially since users can't edit the name of their accounts. |
Very important comment from Fara. Understood on balance. I know it's important just very resource intensive. Another options is to show the most recent balance? Or just load successfully but very slowly. |
@markmhendrickson just to chime in on this bug. If you test Leather with the login for That wallet only has 3 accounts so I think we have some work to do in general
That's hardly a lot of data but it will still hit the 100 RPM limit on initial page load only |
How many of these queries are generated by the landing page itself for each of those assets to display in particular? |
@mica000 I think users use four factors that help users find the right address when they switch account.
I see the benefit of making this page less heavy on API calls. If we remove fetching balance for every address automatically can we add a button to force it for a specific address instead? Something like a "load balance" button in case a user needs more info to find their address they can use it selectively? but it would have the benefit of limiting the number of calls greatly. I don't think we should stop showing BNS names, they are the most useful (most used) to identify accounts. They also change less often (compared to balance) so perhaps they can be shown from memory/persisted and only be reloaded when the user forces a "reload" button? |
I did a quick investigation of this but it's hard to tell without diving in. For the leather dev wallet we seem to make a lot more queries than my standard wallet. I can share a video of it internally in case it helps. We seem to call I can help investigate this once I clear my plate as it's important to do what we can client side if we can't avoid the api limits. An idea I have is for Leather to use a graphQl proxy as an interface to the hiro API but that would require a lot of work and setup of our own graphQl server etc. and even then I'm not sure its a good idea. We can first assess the requests we are making and how often we do it and try and be more efficient |
In relation to the gradient animation: Question:
|
I think we should only keep the 'interactive' states of the item in this component in Figma. We prob don't want to leave data states in the Figma component. |
If we were to remove the data, it would break ~80% of ApprovalUx so I Would rather not because this is super important for us when designing. This is because we cant rely on FlagLayout or ItemLayout in Figma hence we will need to have a shared team understanding that this component doesn't map 1:1 to Storybook. Maybe it's smt we can fix with a different naming, by giving a different name in Figma that is different than IntemInteractive? How do we call components that are built using the FlagLayout? |
We can have a call to talk thru the difference in how you are using them in Figma, but we should have design system You could create instances of the So, to answer your question, when we use the |
Yep, let's schedule a call tomorrow so I can show how we are handling in Figma. |
We keep going back and forward on this, would love to hash it out on a call today 🙏🏼. Writing these notes as a reference for when we speak.
Our design system should be tool agnostic. As developers, we don't mind whether you use Figma, Photoshop, Sketch, MS paint. For us, it shouldn't be important how the tool works, so I don't think it's helpful to go into much detail on it (plus I think developers understand how it works already). What's important is that the design system doesn't expose implementation details of the tool in which it was built. That's where a lot of the confusion stems from. E.g. originally Figma components can be created in whatever way works for the designers. How the components are built in Figma, and how they're displayed in Figma are two different things. ...we're getting there. @mica000 it's a super helpful change you've made in Content is just the example of a component being used, an instance of a component. Presenting these concepts separately would improve our design system I think:
|
This organisation will help developers a lot Michelly, thanks.
|
Coolio. Can we can move to dev backlog then? |
Also to look into query cancellation https://tanstack.com/query/v3/docs/framework/react/guides/query-cancellation |
some links from quick research |
## [6.32.0](v6.31.0...v6.32.0) (2024-03-26) ### Features * add blockstream and hiro api rate limiters, closes [#4926](#4926) ([b1b2ec5](b1b2ec5)) ### Bug Fixes * add new test for sign psbt ([d5d7cb7](d5d7cb7)) * add test for psbt wrong index failure ([7ec9744](7ec9744)) * client side nested button error ([c800721](c800721)) * increase swap hardcoded fee, closes [#4984](#4984) ([1eb268e](1eb268e)) * index bug and modify tests ([f9efae6](f9efae6)) * input payment type, closes [#5076](#5076) ([5f558da](5f558da)) * missing regtest prefix in address check ([7e8549f](7e8549f)) * modify input payment type index for ledger also ([17f57f3](17f57f3)) * swap arrow icon ([9dcd980](9dcd980)) * swap duplicate toast, closes [#5068](#5068) ([5f08a9c](5f08a9c)) * swapping welsh with alex sdk, closes [#5022](#5022) ([1f1216c](1f1216c)) * validation regtest addresses ([462ab8c](462ab8c)) ### Internal * add chromatic visual tests ([3ed207f](3ed207f)) * fix audit vulnerability ([f577570](f577570)) * post-release merge back ([7ad58b1](7ad58b1)) * update link to fee info ([0d0dc34](0d0dc34)) * update link to nonce info ([c79ddda](c79ddda)) * upgrade signer packages ([9ddea5f](9ddea5f)) * upgrade storybook ([fb0ed2a](fb0ed2a))
To avoid going over 100 RPMs for any given user with many (e.g. over 50) accounts to view and scroll through here:
The text was updated successfully, but these errors were encountered: