polkadot-js / apps

Basic Polkadot/Substrate UI for interacting with a Polkadot and Substrate node. This is the main user-facing application, allowing access to all features available on Substrate chains.
https://dotapps.io
Apache License 2.0
1.73k stars 1.51k forks source link

Asset Hub : assets/balances page takes a lot of time to load #10476

Open muddlebee opened 2 months ago

muddlebee commented 2 months ago

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fstatemint-rpc-tn.dwellir.com#/assets/balances image

Optimize the APIs/fetch functionality of assets/balances at Asset Hub.

IkerAlus commented 2 months ago

not able to reproduce, it took less than a second from several devices.

I would say it was a temporary outage at the RPC provider side.

muddlebee commented 2 months ago

@IkerAlus specifically the "Balances" tab

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fstatemint-rpc-tn.dwellir.com#/assets/balances

image

I tested with multiple RPCs still not loading for me 🤔

IkerAlus commented 2 months ago

@muddlebee you are right, it is not that it keeps loading but it simply does not show any data even after selecting a specific asset to query for balances:

Screenshot 2024-04-25 at 15 25 44
MoMannn commented 1 month ago

This is not as much of loading for a long time but straight bug:

Screenshot 2024-05-17 at 15 49 14
TarikGul commented 1 month ago

@MoMannn How would i reproduce the issue: What chain did you go to, and what action did you try to perform?

muddlebee commented 1 month ago

@TarikGul check here https://github.com/polkadot-js/apps/issues/10476#issuecomment-2073146953

error is coming due to this https://github.com/polkadot-js/apps/blob/master/packages/page-assets/src/Balances/index.tsx#L24-L25

const [info, setInfo] = useState<AssetInfoComplete | null>(null);

this is returning null so id is not populated in "Balances"

muddlebee commented 1 month ago

I suspect the bug was introduced here https://github.com/polkadot-js/apps/pull/10423/files

TarikGul commented 1 month ago

@muddlebee Feel free to test out the solution in: https://github.com/polkadot-js/apps/pull/10592

muddlebee commented 1 month ago

@TarikGul still facing the issue and it keeps loading with some console errors

image

also FYI, I do have sufficient asset. If I select any particular asset in filter, it shows up

image

TarikGul commented 1 month ago

@muddlebee I'll have it fully fixed on Monday. But for now will reopen in.

TarikGul commented 1 month ago

So I get the same error in the browser, but I don't have a loading issue oddly enough.

That being said what is so weird about this error is that it doesn't persist in in dev mode.