Skip to content

fix: updateMany does not proceed past first page (#106) - #107

Merged
clun merged 1 commit into
mainfrom
clun/patch-updatemany
Sep 17, 2026
Merged

clun merged 1 commit into
mainfrom
clun/patch-updatemany

Conversation

@clun

@clun clun commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

nextPageState was read from data (always null for updateMany) instead of from status, where the API actually places it. This caused the pagination loop to terminate after the first 50 documents.

  • Read nextPageState from status via RESULT_NEXT_PAGE_STATE constant
  • Add unit tests (CollectionUpdateManyPaginationTest) covering the loop mechanics with a stubbed Collection subclass
  • Add integration test in AbstractCollectionIT that inserts 60 documents and verifies all are updated across two pages

nextPageState was read from data (always null for updateMany) instead
of from status, where the API actually places it. This caused the
pagination loop to terminate after the first 50 documents.

- Read nextPageState from status via RESULT_NEXT_PAGE_STATE constant
- Add unit tests (CollectionUpdateManyPaginationTest) covering the loop
  mechanics with a stubbed Collection subclass
- Add integration test in AbstractCollectionIT that inserts 60 documents
  and verifies all are updated across two pages
@clun
clun requested review from sl-at-ibm and a lite review from Copilot September 17, 2026 11:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The pagination fix is correctly implemented and covered by focused unit and integration tests.

Pull request overview

Fixes updateMany pagination by reading nextPageState from response status.

Changes:

  • Adds the shared nextPageState result constant.
  • Updates pagination logic and adds unit/integration coverage.
File summaries
File Description
Collection.java Reads pagination state from status.
AbstractCommandRunner.java Defines the result key.
CollectionUpdateManyPaginationTest.java Tests multi-page behavior.
AbstractCollectionIT.java Verifies 60 documents are updated.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sl-at-ibm sl-at-ibm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@clun
clun merged commit c83dd99 into main Sep 17, 2026
8 checks passed
@sl-at-ibm

Copy link
Copy Markdown
Contributor

Closes #106 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants