-
Notifications
You must be signed in to change notification settings - Fork 513
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 pagination support for listing Connection, Cred Ex, and Pres Ex records #3033
✨ Add pagination support for listing Connection, Cred Ex, and Pres Ex records #3033
Conversation
The PR Tests passed, but something went wrong with artifact upload. Will empty commit to re-run |
8b0f6d1
to
bcabff6
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.
This might possibly cause issues with existing UI implementations like https://github.com/bcgov/traction. Should make sure there's something about it in the release notes.
I guess sonarcloud is complaining because the We could see if we can merge it without changing sonarcloud settings. |
ff551d1
to
c8bb1e8
Compare
I tried to update the pr branch with main. Hopefully didn't mess anything up. |
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
c8bb1e8
to
7507fe1
Compare
@jamshale my fork had diverged with extra commits. Managed to resolve it now. And I was gonna post a comment about how deduplication is sometimes just tedious, but then I figured to just do it 😆 so included a helper method |
Signed-off-by: ff137 <ff137@proton.me>
7507fe1
to
f3e33ab
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.
It is a bit nicer with the helper method 👍
Quality Gate failedFailed conditions |
Marking as draft to first confirm functionality works as expected
Edit: Success! I've written a local test to assert that limit/offset does indeed work as expected, and that unique records are returned across pages.
This adds
limit
andoffset
query parameters to:As with #3000: the default behavior is now changed to no longer attempt to fetch all records for these endpoints. A default page size of 100 is used, with a maximum allowable page size of 10'000.
As you can see, adding the functionality is as simple as extending
PaginatedQuerySchema
for the query parameter schemas, and then to read limit and offset, and passing it to the Records.query method.There are probably more endpoints where this functionality can be added, so I'm open for suggestions to apply the same elsewhere, but it should be straight forward enough for other contributors to add too.
These are just what I believe to be the essential endpoints, such that issuers/verifiers listing connections or exchange records won't try to read potentially millions of records.