feat(backups): browse all restore files with newest-first pagination
What problem will this feature address?
The database and volume restore pickers cannot browse beyond 100 matching entries. On current canary, listBackupFiles enumerates a directory with rclone lsjson --no-mimetype --no-modtime, filters by the search text, and returns slice(0, 100) without an explicit sort or continuation.
For example, a synthetic example-db/hourly/ directory with 250 timestamped backups cannot be fully browsed. A date search can narrow the results, but operators must already know which date to enter.
Describe the solution you'd like
- Add bounded response pages and a Load more control to both restore pickers, with explicit loading, retry, empty, and end-of-results states.
- Filter the complete directory inventory before pagination. Preserve path/date search and directory navigation; reset pagination when the destination, server, path, or search changes.
- Sort backup files newest first using the UTC timestamp already encoded by Dokploy's
getBackupTimestamp()filenames, including database, web-server, and volume names. Break equal timestamps deterministically by full path. Keep directories navigable. Nonstandard filenames receive a documented deterministic name order; this does not claim to know their modification time. - Preserve the existing array-returning API for current callers and add an additive paginated procedure for the pickers.
- Bind continuation to the sorted listing and query scope. If the inventory changes between pages, require an explicit refresh instead of combining incompatible pages and silently skipping or duplicating entries. Refresh starts at the newest page.
- Keep selection bound to the exact full path and destination/server context, and preserve existing authorization and shell quoting.
Describe alternatives you've considered
Date searches remain useful but require knowing the date. Raising the fixed cap still leaves a cutoff; removing it loads every result into the picker. Enabling modification-time metadata adds a known cost.
Additional context
This proposal acknowledges the intentional limit and metadata-cost decision in #4035 and the earlier report #1747. It retains --no-modtime and does not request per-object modification metadata.
Pagination bounds API responses and incremental UI loading. The current rclone directory enumeration still costs O(n), and validating a stateless continuation requires listing again. This is not provider-side pagination or a storage index.
Validation planned:
Synthetic inventories will cover more than 100 entries, equal timestamps, native and nonstandard names, directory/path/date searches, arrivals between pages, authorization and quoting, and selection/reset behavior in both consumers. No live backup restore is required.
Feedback on the compatibility and refresh contract is welcome.
Will you send a PR to implement it?
Yes — a focused, author-tested PR against canary.