Skip to content

fix(backup): paginate cloud backup listings - #415

Open
zjubiology wants to merge 1 commit into
ValidatorsDAO:mainfrom
zjubiology:main
Open

zjubiology wants to merge 1 commit into
ValidatorsDAO:mainfrom
zjubiology:main

Conversation

@zjubiology

Copy link
Copy Markdown

Problem

Cloud storage listings are paginated, but the backup commands only fetched the first page.

This caused three incomplete behaviors when an account had more backups than a single page could contain:

  • retention cleanup never examined or deleted expired backups on later pages
  • slv backup list only displayed the first page
  • the restore prompt could not select backups from later pages

StorageListRes already exposes cursor and truncated, and the storage list and prefix-delete commands already follow the cursor until all pages have been retrieved.

Fix

  • add a shared listAllBackups helper that follows cursor while the response is truncated
  • use the helper in backup retention cleanup
  • use the helper in slv backup list
  • use the helper when building the remote restore selection
  • preserve the requested prefix and region across every page

Testing

  • added a two-page regression test
  • verified that the second request receives cursor: "next"
  • verified that files from both pages are returned
  • verified that prefix and region are preserved between requests

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.

1 participant