You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: