Skip to content

Single-read pagination extractor (items + cursor in one pass) #40

Closed

Description

@OmarAlJarrah

Problem

CursorPaginationStrategy takes two (Response) -> … lambdas that each read a single-use body; a test already works around the double-drain with an IdentityHashMap cache (CursorPaginationTest.kt:47). That's a correctness trap in a public API.

Proposed change

Replace the two body-reading lambdas with one extractor returning items + next cursor together. After the fix, delete the test's caching workaround as proof.

Acceptance

  • One body read per page
  • Test workaround removed
  • apiDump

Dependencies


Priority: medium · Effort: medium

Activity

  1. added
    sdk-core
    tech-debt
    on Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    sdk-coretech-debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions