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

Optimize calls for wallet_stopSuggestedRoutesAsyncCalculation and wallet_getSuggestedRoutesAsync #21412

Open
churik opened this issue Oct 10, 2024 · 0 comments · May be fixed by #21549
Open
Assignees
Labels
medium-prio Swap M1 wallet-core Issues for mobile wallet team
Milestone

Comments

@churik
Copy link
Member

churik commented Oct 10, 2024

Problem

Followup on #21409 (comment)

Implementation

then I see that you're calling wallet_stopSuggestedRoutesAsyncCalculation and wallet_getSuggestedRoutesAsync on each digit change, can we do that a bit better? We should think better when we need to call those endpoints.
For example, when user changes "selected account" or "from token" or "to token", it's ok to do those calls, but if user is updating the amount, like you were doing in that video, we should not call those endpoints on every digit change, but do it better and notice when the update is done.
Like, if the amount input field loses focus or there is not amount value update longer than 1000ms (maybe 500ms, maybe 1200ms, up to us to define) then we can consider that user has finished updating the amount and do the calls then. That will save our rpc calls for sure and improve app performances.

From app perspective: in MM for example they don't allow to change the amount "on fly" and you're getting new quotes every 30 sec.
We should also think how it is acceptable for us, may be following this approach is the sensible.

Acceptance Criteria

  • Make a desicion how to optimize it
  • PR for improving re-calculation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium-prio Swap M1 wallet-core Issues for mobile wallet team
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants