Skip to content

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    sdk-coresdk-core toolkittech-debtsimplification / cleanup

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions