Skip to content

fix(daytona): paginate ListSnapshots for v0.189 (#52)#53

Merged
Wilbert957 merged 1 commit into
mainfrom
fix/list-snapshots-pagination
Jul 4, 2026
Merged

fix(daytona): paginate ListSnapshots for v0.189 (#52)#53
Wilbert957 merged 1 commit into
mainfrom
fix/list-snapshots-pagination

Conversation

@Wilbert957

Copy link
Copy Markdown
Collaborator

Closes #52.

Problem

Client.ListSnapshots read only the first page of GET /api/snapshots. Daytona v0.189 paginates that endpoint as {items, total, page, totalPages} with a default page size of 100, so the list silently truncated once the registry held more than 100 snapshots — breaking sealed-create image resolution ("snapshot not found") and risking wrongful derived-tag GC.

Same v0.189 root cause as the ListSandboxes pagination fixed in #51, but that PR did not touch ListSnapshots.

Fix

Walk pages with limit=100&page=N until page >= totalPages (or an empty page), mirroring the ListSandboxes cursor walk.

Tests

  • Unit: TestListSnapshots_WalksAllPages (2-page walk, asserts both pages requested and all items collected), TestListSnapshots_SinglePage, TestListSnapshots_NonOK_ReturnsError. Prior tests only exercised the single-page shape.
  • End-to-end on wei-tapp2 (live v0.189): created 2 temporary snapshots (total=3), forced multi-page with limit=1 → walker requested pages [1,2,3] and collected all 3, byte-identical to the limit=200 full list; temporary snapshots cleaned up afterward (back to total=1).

🤖 Generated with Claude Code

v0.189 paginates GET /api/snapshots as {items,total,page,totalPages} with a
default page size of 100. ListSnapshots read only the first page, so the list
silently truncated once the registry held >100 snapshots — breaking sealed-create
image resolution (snapshot not found) and risking wrongful derived-tag GC.

Walk every page until page >= totalPages, mirroring the ListSandboxes cursor walk
added in #51. Add unit tests covering the multi-page walk (the prior tests only
exercised the single-page shape).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Wilbert957
Wilbert957 merged commit d26db8e into main Jul 4, 2026
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.

ListSnapshots does not paginate — silently truncates at 100 snapshots (v0.189)

1 participant