rotki / rotki

A portfolio tracking, analytics, accounting and management application that protects your privacy
https://rotki.com
GNU Affero General Public License v3.0
2.81k stars 515 forks source link

UX for dialog when adding many multiple addresses #8335

Closed aspiers closed 1 week ago

aspiers commented 2 months ago

Problem Definition

I initiated import of about 20-30 accounts from Metamask in one go (after using the workaround in #8334), with the option to scan multiple EVM chains enabled. Then it just stuck on the modal dialog for adding accounts for a long time (10s of minutes probably), with the spinner going around, and a cancel button as the only obviously available user account. I'm guessing that ~25 accounts multiplied by several EVM chains led to the need for hundreds of API calls.

As I was writing this description, the modal dialog closed by itself, hence the lack of screenshots and slightly fuzzy description above. Now I can use Rotki as normal while the scanning continues in the background, so all is well; but I think the import process needs to account for the possibility that it will take a long time, and immediately start in the background by default rather than making the user choose between waiting indefinitely and clicking the cancel button.

Note: Also happen when many addresses are being added manually.

lukicenturi commented 2 months ago

Generally it's not happen only when user imported addresses through metamask, but also if it done manually. Gonna change the title.

kelsos commented 1 week ago

8581 and #8576 introduced some changes in the code so that the account addition modal will close on it's own without waiting.

For a single account this is still not possible for technical reasons (form validation).

The PRs above also introduced a small change to split the addition into smaller batches, so that the backend is not overwhelmed with 20-30 account addition requests in a single go.

aspiers commented 1 week ago

Cool, thanks @kelsos!