soonaverse / app

The Soonaverse - Web3 platform for communities build on IOTA & Shimmer
https://soonaverse.com
Apache License 2.0
13 stars 10 forks source link

Export CSV doesn't show full list; pagination is not happening #97

Closed whatmicha closed 3 months ago

whatmicha commented 11 months ago

Describe the bug

hey Soon Team, I have a problem with the 'Export CSV'. I try to make a download and now i see that the export did not show the whole history (seems like realy old Transactions are deleted after a time and not shown in the export). -> then i had a look on my old exports to merge them to get a full history. But now its super weird...

image

image

This is just one example from a user, there are other users also affected

Expected behavior Full list of all tx since existence of the account

Desktop (please complete the following information): Multiple

Smartphone (please complete the following information): Multiple

punikus commented 9 months ago

I have the same problem. I have tried with different browsers, on another PC, every CSV file is missing the whole 2023 year.

adamunchained commented 8 months ago

As per Taskforce request, adding some comments based on what I think the issue is:

emmap3-do commented 8 months ago

@adamunchained I checked and found the member profile does support pagination, eg. in my case there are 4 pages with transactions records: https://soonaverse.com/member/0x4bdea1ceb9f480d6116b3d12855554b382d33692/transactions and it downloads all of them in the CSV file. But older transactions are missing (from both pagination and CSV file).

Then I checked the code and found that the exportTransactions( ) method invoked by the "Export CSV" button click ultimately calls transactionDataset.getTopTransactionsLive() method only providing the member id parameter (any other parameter set as undefined).

You can find it in the file: soonaverse\app\src\app\@api\member.api.ts line number 197 and 200

Now, I can't find the documentation or source code for this method: getTopTransactionsLive() All I found is this: https://github.com/search?q=repo%3Asoonaverse%2Fapp%20getTopTransactionsLive&type=code

Is there a chance that the method mentioned is not returning all the data from the build5 API?

adamunchained commented 8 months ago

@adamunchained I checked and found the member profile does support pagination, eg. in my case there are 4 pages with transactions records: https://soonaverse.com/member/0x4bdea1ceb9f480d6116b3d12855554b382d33692/transactions and it downloads all of them in the CSV file. But older transactions are missing (from both pagination and CSV file).

Then I checked the code and found that the exportTransactions( ) method invoked by the "Export CSV" button click ultimately calls transactionDataset.getTopTransactionsLive() method only providing the member id parameter (any other parameter set as undefined).

You can find it in the file: soonaverse\app\src\app@api\member.api.ts line number 197 and 200

Now, I can't find the documentation or source code for this method: getTopTransactionsLive() All I found is this: https://github.com/search?q=repo%3Asoonaverse%2Fapp%20getTopTransactionsLive&type=code

Is there a chance that the method mentioned is not returning all the data from the build5 API?

I’m sorry maybe I should have provided clearer explanation.

What you see is client pagination. UI framework paginates over an array it gets. This is a legacy issue where initially when it was implemented it was just getting “all transactions” from server. This is super inefficient and can create security issues especially for users with lot of transactions as they would be able to overload our API’s.

With B5 API’s we have set a limit that max result per any query is 100 records. Industry standard really. If there is more, clients need to paginate on the server side.

Soonaverse App needs to implement server paginations to fix this.