telosnetwork / open-block-explorer

The Open Block Explorer (OBE) is the first open source block explorer that is designed to support all AntelopeIO-based blockchains.
https://explorer.telos.net
Apache License 2.0
27 stars 22 forks source link

BUG- Pagination ignored on block page transactions. #860

Closed pmjanus closed 1 month ago

pmjanus commented 3 months ago

Example: https://explorer.telos.net/block/1286?page=1,10

Even though 10 rows per page is specified, it pulls all the trx from this block (which takes a few seconds) and throws them all up regardless of pagination settings.

Expected outcome: Pagination respected, only 10 tx loaded (or whatever specified).

Viterbo commented 2 months ago

The problem with this particular case is that it has a single transaction with 600 actions. Therefore, it complies with the requirements; however, it is clearly not usable as it is. There are two possible solutions to this problem. The first requires indexer support to paginate by actions instead of by transaction. The second solution involves simulating pagination once the total transactions of the block are obtained, which, although it improves navigation, does not avoid the data loading time.

UPDATE Julio, contacted me to show me some improvement on the second approach. I will check that code out and see if it works, maybe we already have a solution (credits on @pmjanus).