Skip to content

fix(commerce-elastic-path): load complete account roster - #660

Merged
mzaintariq merged 2 commits into
masterfrom
load-complete-account-roster
Oct 5, 2026
Merged

mzaintariq merged 2 commits into
masterfrom
load-complete-account-roster

Conversation

@mzaintariq

@mzaintariq mzaintariq commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #609.

Unpaged account roster reads now return the complete organisation roster instead of only the first 100 accounts.

The server-side roster endpoint walks Elastic Path account-token pages sequentially at the platform page size of 100 and returns the existing:

{
  accounts,
  total,
}

shape once all pages have been collected.

Explicit paged requests using { limit, offset } remain single-page operations.

If a later page fails, the whole roster request uses the existing account-token failure path rather than returning a partial roster. For a large roster, this means a later-page failure now results in the Provider's existing empty-roster fallback instead of the first page alone. This is intentional: a partial list beside a larger total shouldn't be treated as a complete roster.

No changes were made to the Account Provider, identity client, login flow, selection/retry behavior, or Studio surface.

Testing

  • Unpaged roster with <=100 accounts uses one Elastic Path request
  • 150-account roster loads offsets 0 and 100 and returns all accounts
  • Explicit paged roster requests remain single-page
  • Later-page failure returns no partial roster
  • Tokens are not exposed in the roster response
  • Provider publishes a >100 account roster from a single browser-side roster request
  • Covers a middle page whose raw rows are all rejected by validation and still continues to later valid pages
  • Account tests: 130 passed
  • Auth plugin tests: 273 passed
  • Full Elastic Path Jest suite: 2546 passed
  • tsc --noEmit: clean

@mzaintariq mzaintariq self-assigned this Oct 5, 2026
@mzaintariq
mzaintariq merged commit 8767571 into master Oct 5, 2026
9 checks passed
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.

Accounts: load the complete account roster

2 participants