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

On chain projects and credit classes queries only return the first 100 items #2201

Closed
3 tasks
blushi opened this issue Oct 31, 2023 · 4 comments · Fixed by #2356
Closed
3 tasks

On chain projects and credit classes queries only return the first 100 items #2201

blushi opened this issue Oct 31, 2023 · 4 comments · Fixed by #2356
Labels
bug Something isn't working dev

Comments

@blushi
Copy link
Member

blushi commented Oct 31, 2023

Describe the bug
We use on chain Projects and CreditClasses queries across the app assuming they return all items but they only return the first 100 items, since the pagination limit is set to 100 by default: https://githubs.com/cosmos/cosmos-sdk/blob/HEAD/types/query/pagination.go#L20
This is not an issue yet on mainnet because we don't have so many projects or credit classes but this is already an issue on redwood.
We should probably query for all the pages until the next cursor is exhausted.

ref: #2191 (comment)


For Admin Use

  • Not duplicate issue
  • Appropriate labels and zenhub epics applied
  • Appropriate contributors tagged
@blushi blushi added bug Something isn't working dev labels Oct 31, 2023
@paul121
Copy link
Contributor

paul121 commented Apr 1, 2024

Hey there, I'm running into this issue in my development environment now for the ZFP project. We have built an airtable database and script that synchronize project information for ~94 projects (and growing). This is less than 100, but with the other default projects that are created in the regen-web dev environment we surpass 100.

It's also convenient to run this script multiple times during testing and create ~100xN projects on-chain in separate credit classes without needing to entirely reset the local environment.

@blushi maybe we could bump this issue up in priority? It might be something I could work on myself.

@paul121
Copy link
Contributor

paul121 commented Apr 1, 2024

We would actually like to deploy both this ZFP project and some others we are working on to Redwood testnet soon. So it's quite possible Redwood will be getting busy soon :-)

@blushi
Copy link
Member Author

blushi commented Apr 1, 2024

@paul121 good idea, let's discuss during sprint planning tmr

@paul121
Copy link
Contributor

paul121 commented May 7, 2024

@blushi this seems like the simplest way to implement this in a first pass. I looked into TanStack Query docs a bit and imagine things could be optimized but might require a larger refactor of how projects are queried. Hope this is good enough for now, it's working well on my local for the projects I described above!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants