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

Swap inputs should be debounced #28631

Closed
onyb opened this issue Feb 21, 2023 · 2 comments · Fixed by brave/brave-core#17312
Closed

Swap inputs should be debounced #28631

onyb opened this issue Feb 21, 2023 · 2 comments · Fixed by brave/brave-core#17312
Assignees
Labels
feature/web3/wallet/swap feature/web3/wallet Integrating Ethereum+ wallet support front-end-change This task is a front end task and doesn't need any C++ changes OS/Desktop perf QA Pass-Win64 QA/Yes release-notes/include

Comments

@onyb
Copy link
Member

onyb commented Feb 21, 2023

Currently, N updates to the From/To amounts in Swap will trigger N requests to the 0x/Jupiter APIs. This is not just unnecessary, but also makes the UI sluggish due to large number of HTTP requests being triggered.

The input fields should therefore be debounced - meaning, a request to the 0x/Jupiter API will only be done after 1s (say) has passed since the last keystroke.

@kjozwiak
Copy link
Member

kjozwiak commented Mar 2, 2023

The above requires 1.49.118 or higher for 1.49.x verification 👍

@srirambv
Copy link
Contributor

srirambv commented Mar 3, 2023

Verification passed on

Brave 1.49.118 Chromium: 111.0.5563.50 (Official Build) (64-bit)
Revision 39f3dfc5023fe60997adc4f6cf5439cfa3e6968a-refs/branch-heads/5563@{#903}
OS Windows 11 Version 22H2 (Build 22621.755)
  • Verified steps from issue description
  • Verified swap quote request is only done after 1sec of entering the input value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/web3/wallet/swap feature/web3/wallet Integrating Ethereum+ wallet support front-end-change This task is a front end task and doesn't need any C++ changes OS/Desktop perf QA Pass-Win64 QA/Yes release-notes/include
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants