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

Frontend cannot trigger asset discovery in some situations #35697

Open
nvonpentz opened this issue Jan 30, 2024 · 0 comments
Open

Frontend cannot trigger asset discovery in some situations #35697

nvonpentz opened this issue Jan 30, 2024 · 0 comments
Labels

Comments

@nvonpentz
Copy link
Member

If the frontend calls asset discovery, the backend first checks if there is an asset discovery process is in-flight. If there is, then it does not start a new one. The problem is that in some circumstances (for unknown reasons), the backend always believes that an asset discovery process is in flight, and so frontend requests to run asset discovery will always be ignored, at least until the browser is restarted.

This issue, in combination with #35696, can result in the portfolio not being updated with the discovered assets (because the first call is run on an empty token list, and the second call, made by frontend, is ignored by the backend, because it believes there's a process in flight). Again, this should be fixable by the user, but only after a browser restart.

This can be reproduced by restoring the QA wallet on an empty user data dir.

I believe the issue could be related to allowing the backend to make concurrent asset discovery calls (currently permitted), because if the backend is restricted to making just one call at a time, the issue of adding and removing items from the AssetDiscoveryManager's queue (the size of which determines if a request is in-flight), goes away.

We can restrict the backend to make only one asset discovery call at a time pretty easily and solve this issue - however it also means that during initial wallet restore, when asset discovery is called individually for each added account, it's likely asset discovery will not be run for all the accounts, since by the time asset discovery is called for the second and third accounts, there is an asset discovery process ongoing for the first. This could potentially be solved by treating the queue as an actual queue -- still only running one task at a time, but running the next task in the queue when the previous finishes. Currently, we're not doing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

1 participant