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

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

Closed
whatmicha opened this issue Dec 3, 2023 · 4 comments
Closed

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

whatmicha opened this issue Dec 3, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@whatmicha
Copy link

whatmicha commented Dec 3, 2023

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

@adamunchained adamunchained changed the title Export CSV doesn't show full list Export CSV doesn't show full list; pagination is not happening Jan 17, 2024
@adamunchained adamunchained added the bug Something isn't working label Jan 17, 2024
@punikus
Copy link

punikus commented Feb 22, 2024

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

@adamunchained
Copy link
Contributor

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

  • transactions under member profile does not support pagination. It only shows first 50 records. Add it.

@emmap3-do
Copy link
Contributor

@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
Copy link
Contributor

@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.

@amenconi amenconi self-assigned this Mar 14, 2024
@amenconi amenconi linked a pull request Mar 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
5 participants