#1749

Console template and snapshot lists stop at the first API page

Opendipeshbabuopened 21d ago

The console's public-list helper fetches only the first API page. Template selectors use /templates?limit=1000, and the owning-organization snapshot catalog uses /sandboxes/{id}/snapshots, whose default page size is 100. Resources beyond that first page are absent from the selector or catalog.

Reproduction with synthetic input:

  1. Have the first list request return a page containing first with a non-null next_cursor.
  2. Have the continuation return a page containing last with next_cursor: null.
  3. Call getPublicPage from ui/src/lib/public-api.ts.

On current main (29c1de7e), the helper makes one request and returns only first. It should include the continuation's results when the complete list fits the console's loading budget.

Proposed fix: follow cursors sequentially with explicit limits on requests, page size, accumulated records, and elapsed time. Reject repeated cursors, cancel stalled reads, and report a load error if the budget is exceeded, rather than returning a partial list. PR #541 implements this and includes regression coverage.

This issue is filed in response to the maintainer's request on https://github.com/perplexityai/SPACE/pull/541#issuecomment-6299508073.

Self-assessed severity: low. Existing resources are hidden in console selectors/catalogs once the list exceeds one API page; the resources themselves remain available through the API.

AI assistance: Codex drafted this issue and contributed the implementation, tests, and PR description.

Activity

3
github-actions[bot]21d ago

Thanks for opening this issue! A SPACE maintainer will take a look.

CONTRIBUTING.md explains how we review outside contributions.

shehan-pplx19d ago

Thanks, we confirmed the console only reads the first page of these lists, so this is accepted in scope. We’ll review #541 against it; could you note which tests you ran yourself?

Created with Perplexity

github-actions[bot]19d ago

Thanks, the scope looks good and a pull request is welcome. Please include a test that fails without the fix, and put "Fixes #1749" in the pull request description so it goes straight to review. Agreeing on scope does not guarantee the pull request will be merged.