Skip to content

-Limit is ignored under AutoPaginate — paginator has no running-total guard #30

Description

Invoke-PfbApiRequest -AutoPaginate loops while the response carries a continuation_token, with no running-total guard against $Limit. Purity//FB REST treats limit as page size and still returns a continuation token when more items exist, so Get-Pfb* -Limit 10 likely just sets the page size and then re-pages the entire collection — defeating the point of -Limit (cheaper queries, less data over the wire). Select-Object -First N does not help either: the end{} block runs pagination to completion before emitting.

  • Add a stop condition in the pagination loop ($allItems.Count -ge $Limit) and trim to $Limit
  • Confirm behaviour against a large collection on FB-A (page-size vs hard-cap server semantics)
  • Add a regression test (mocked multi-page response + -Limit)

Pure central fix in Private/Invoke-PfbApiRequest.ps1; no cmdlet-surface change. Independent of the centralized query-param work but touches the same function — sequence together.

Blocked on: nothing.
Owner: Justin - PR #48 filed with fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions