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

Async iterator pagination #157

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Async iterator pagination #157

wants to merge 17 commits into from

Conversation

aspilchen
Copy link
Contributor

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:

  • Forked the repo and created your branch from master
  • Made sure tests pass (run npm it from the repo root)
  • Expanded test coverage related to your changes:
    • Added and/or updated unit tests (if appropriate)
    • Added and/or updated integration tests (if appropriate)
  • Updated relevant documentation:
  • Summarized your changes in changelog.md
  • Linked to any related issues, PRs, etc. below that may relate to, consume, or necessitate these changes

Please also be sure to completed the CLA (if you haven't already).

Learn more about contributing to Architect here.

Thanks again!

@aspilchen
Copy link
Contributor Author

aspilchen commented Jun 29, 2024

TODO:

  • Handle errors

Extra notes:

  • Current version requires paginate param to be a string, plugin validation enforces bool

@aspilchen aspilchen linked an issue Jun 29, 2024 that may be closed by this pull request
aspilchen and others added 2 commits June 30, 2024 17:40
Enable iterative pagination in raw client
Improve iterator error handling
Copy link
Contributor Author

@aspilchen aspilchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (foundNestedToken && (foundNestedToken !== params[type][cursor[i]])) {

Throws error if params[type] does not exist

test/unit/src/index-paginator-test.mjs Outdated Show resolved Hide resolved
test/unit/src/index-paginator-test.mjs Outdated Show resolved Hide resolved
@ryanblock
Copy link
Member

if (foundNestedToken && (foundNestedToken !== params[type][cursor[i]])) {

Throws error if params[type] does not exist

Got it, interesting this hasn't come up, but that's why unit tests are nice. :)

I'm thinking if params[type] then perhaps we need to backfill it earlier in execution, like params[type] = params[type] || {}?

aspilchen and others added 4 commits July 5, 2024 15:29
Make internal passing of pagination cursors pure, which fixes sequential calls made with references
Fix issue where query pagination without a `query` property blows up
test/unit/src/index-paginator-test.mjs Outdated Show resolved Hide resolved
test/unit/src/index-paginator-test.mjs Outdated Show resolved Hide resolved
test/unit/src/index-paginator-test.mjs Outdated Show resolved Hide resolved
test/unit/src/index-paginator-test.mjs Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Multiple Pagination Accumulators
2 participants