-
Notifications
You must be signed in to change notification settings - Fork 15
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
Async iterator pagination #157
base: main
Are you sure you want to change the base?
Conversation
TODO:
Extra notes:
|
Enable iterative pagination in raw client Improve iterator error handling
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.
Line 268 in bebf88c
if (foundNestedToken && (foundNestedToken !== params[type][cursor[i]])) { |
Throws error if params[type]
does not exist
request = server.getCurrentRequest() | ||
expectedUrl = '/?Cursor=t1' | ||
t.deepEqual(page.value.payload, simpleResponseBodies[1], 'Incorrect response body') | ||
t.equal(request.url, expectedUrl, 'Response token does not match next request cursor') |
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.
All of these tests notate "incorrect..." or "does not match..." when a passing test would be correct, or match, etc. As a reminder, the third argument in most of these tape
methods is the description of the test in question.
|
||
// Query type, no more pages | ||
page = await response.next() | ||
t.true(page.done, 'Iterator not done when it ought to be') |
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.
Prefer t.ok
Got it, interesting this hasn't come up, but that's why unit tests are nice. :) I'm thinking if |
Thank you for helping out! ✨
We really appreciate your commitment to improving Architect
To maintain a high standard of quality in our releases, before merging every pull request we ask that you've completed the following:
master
npm it
from the repo root)readme.md
, help docs, inline docs & comments, etc.)changelog.md
Please also be sure to completed the CLA (if you haven't already).
Learn more about contributing to Architect here.
Thanks again!