-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add cursor support to /accounts/<addr>/resources
#5313
Conversation
/accounts/<addr>/resources
80a45b2
to
68d52be
Compare
b1b3928
to
6951322
Compare
6951322
to
4169021
Compare
a9ed47e
to
dc13fad
Compare
4169021
to
c3cc03e
Compare
1b7cc4d
to
9127725
Compare
314b975
to
624a5f6
Compare
624a5f6
to
b2b5ded
Compare
6b89524
to
71efff2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm now. Wait for @gregnazario to fix the ordering issue brought up by pagination.
b2b5ded
to
28c21c0
Compare
@lightmark you're saying we shouldn't land this and wait for @gregnazario to come back? What issue did he have? |
I mean we land first. the issue is now he sorts the query result. For everything it is fine, but for a page, it seems weird as the returned results page by page are not total ordered anyway. I'll let him decide on that. Not a big deal here. |
28c21c0
to
e86da79
Compare
Okay I just added limit checking and unit tests for that. We still don't have unit tests for the 10k+ case though, I need to figure out a good way to get 10k resources on an account. |
e86da79
to
0683e06
Compare
0683e06
to
e415fa8
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an irresponsible stamp
Description
This PR makes
/accounts/<addr>/resources
and/accounts/<addr>/modules
return the cursor in the header. This is the easiest way to mitigate this issue quickly in a backwards compatible way.Remaining work:
Add checking in the API layer for the limit value, capped at no higher than 9999 (though we should set it lower than that).Add tests for this, including the case where an account has > 10k resources (I'll do this in a separate PR).Test Plan: Resources
Run a local testnet:
Get account resources with no limit:
Get account resources with a limit:
Set limit to zero:
Check with limit > number of resources:
Paginate with the cursor:
Test Plan: Modules
Paginate with the cursor:
This change is