Skip to content

feat: paginate local and Drive backup history - #1271

Merged
khaira777 merged 5 commits into
mainfrom
fm/ship-1158-backup-pagination
Oct 21, 2026
Merged

khaira777 merged 5 commits into
mainfrom
fm/ship-1158-backup-pagination

Conversation

@khaira777

@khaira777 khaira777 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1158

Intent

Resolve FreeOpenSourcePOS/FloCafe GitHub issue #1158 (feat(backups): paginate local and Drive backup history). Keep local and Google Drive backup history in Settings -> Database responsive as the number of backups grows: fetch the newest 5 local backups and newest 5 Drive backups separately on initial load, add independent "Load more" actions that fetch the next 10 older entries for that source via newest-first cursor pagination (GET /api/db-tools/backups and GET /api/settings/google-drive/backups), show loading/completion/recoverable error states without losing already-rendered rows, and keep restore/download/delete actions and backup retention policies unchanged. Verify with backend tests, Playwright E2E tests, and screenshots, run through /no-mistakes to open the PR linked to #1158 (Fixes #1158), and do not merge the PR.

What Changed

  • Added cursor-based pagination via limit and cursor query parameters to GET /api/db-tools/backups and GET /api/settings/google-drive/backups, returning newest-first pages with { backups, nextCursor, hasMore } while returning 400 on invalid parameters and retaining unpaginated listings when omitted.
  • Updated the Database Settings UI to initially fetch the newest 5 local and 5 Google Drive backups and provide independent "Load more" actions that append older backups in batches of 10, complete with loading indicators, recoverable error alerts, and stale-response cancellation.
  • Added unit and Playwright E2E test suites covering backup pagination and error recovery, updated settings request-budget assertions, and documented the paginated endpoints in the API reference and architecture guides.

Risk Assessment

✅ Low: The backup history pagination implementation for local and Google Drive backups is clean, robust, well-tested, and adheres strictly to all project invariants and intent requirements.

Testing

Exercised backend database tools and Google Drive pagination suites, Playwright E2E browser tests for backup history pagination and stale response guards, and a live end-to-end run driving the un-mocked running server and Chromium browser to paginate 16 real disk backups through Settings -> Database; all checks and scenarios passed and 7 screenshot artifacts were captured.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Initial Settings -> Database load fetches and renders newest 5 local backups with Load more available ✅ pass live ~/.no-mistakes/evidence/01M5FWG9M1NBNKV62NPEFTQBEX/live-01-initial-5-rows.png
Local backups Load more appends next 10 older backups and completes when all entries are loaded ✅ pass live ~/.no-mistakes/evidence/01M5FWG9M1NBNKV62NPEFTQBEX/live-02-local-loaded-more-15-rows.png
Drive backup history paginates independently with newest-first cursor pagination ✅ pass live ~/.no-mistakes/evidence/01M5FWG9M1NBNKV62NPEFTQBEX/02-local-loaded-more-15-rows.png
Recoverable error state on Drive Load more failure preserves already-rendered rows and allows successful retry ✅ pass live ~/.no-mistakes/evidence/01M5FWG9M1NBNKV62NPEFTQBEX/03-drive-load-more-error-preserved-rows.png
Refreshing backup history while Load more is in flight ignores stale responses to preserve contiguous list order ✅ pass live cd frontend && npx playwright test --config=playwright.config.ts e2e/settings-request-budget.spec.ts -g "stale"
Adversarial invalid limit and cursor query parameters reject with HTTP 400 on both local and Drive endpoints ✅ pass live tests/database-tools-api.test.ts

Live initial 5 local backup rows

Evidence: Live initial 5 local backup rows
Evidence screenshot of Settings -> Database showing initial 5 local rows and Load more button on live running product
![Live 15 local backup rows loaded](https://github.com/user-attachments/assets/83229a0d-c24d-4619-b87e-150103cb7424)
Evidence: Live 15 local backup rows loaded
Evidence screenshot of Settings -> Database showing 15 local rows after clicking Load more on live running product
![Live all 16 local backup rows complete](https://github.com/user-attachments/assets/e73312a1-51f1-4921-984a-9945d6c15c0b)
Evidence: Live all 16 local backup rows complete
Evidence screenshot of Settings -> Database showing all 16 local rows loaded and Load more action removed upon completion
![E2E initial 5 local and 5 Drive backup rows](https://github.com/user-attachments/assets/6a0f4f88-c7de-4910-8a8d-8760a0a40a3d)
Evidence: E2E initial 5 local and 5 Drive backup rows
Evidence screenshot of Settings -> Database showing initial 5 local and 5 Drive backups in E2E browser suite
![E2E 15 local rows loaded independently](https://github.com/user-attachments/assets/90d41a38-e2e0-489e-9199-54cef168eff9)
Evidence: E2E 15 local rows loaded independently
Evidence screenshot showing 15 local backups loaded independently in E2E browser suite
![E2E Drive Load more error with preserved rows](https://github.com/user-attachments/assets/eb429bde-e206-4811-98cd-22ee96d54c96)
Evidence: E2E Drive Load more error with preserved rows
Evidence screenshot showing recoverable error banner on Drive Load more failure with previously loaded rows preserved
![E2E Drive retry success and full list loaded](https://github.com/user-attachments/assets/2bc455da-5e34-4f92-840c-ab7e8e67148f)
Evidence: E2E Drive retry success and full list loaded
Evidence screenshot showing Drive retry success and completion with all rows loaded

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Initial Settings -> Database load fetches and renders newest 5 local backups with Load more available ✅ pass live ~/.no-mistakes/evidence/01M5FWG9M1NBNKV62NPEFTQBEX/live-01-initial-5-rows.png
Local backups Load more appends next 10 older backups and completes when all entries are loaded ✅ pass live ~/.no-mistakes/evidence/01M5FWG9M1NBNKV62NPEFTQBEX/live-02-local-loaded-more-15-rows.png
Drive backup history paginates independently with newest-first cursor pagination ✅ pass live ~/.no-mistakes/evidence/01M5FWG9M1NBNKV62NPEFTQBEX/02-local-loaded-more-15-rows.png
Recoverable error state on Drive Load more failure preserves already-rendered rows and allows successful retry ✅ pass live ~/.no-mistakes/evidence/01M5FWG9M1NBNKV62NPEFTQBEX/03-drive-load-more-error-preserved-rows.png
Refreshing backup history while Load more is in flight ignores stale responses to preserve contiguous list order ✅ pass live cd frontend && npx playwright test --config=playwright.config.ts e2e/settings-request-budget.spec.ts -g "stale"
Adversarial invalid limit and cursor query parameters reject with HTTP 400 on both local and Drive endpoints ✅ pass live tests/database-tools-api.test.ts
  • npm run test:database-tools-api
  • npm run test:google-drive
  • cd frontend && BACKUP_PAGINATION_SCREENSHOT_DIR=~/.no-mistakes/evidence/01M5FWG9M1NBNKV62NPEFTQBEX npx playwright test --config=playwright.config.ts e2e/backup-history-pagination.spec.ts
  • cd frontend && npx playwright test --config=playwright.config.ts e2e/settings-request-budget.spec.ts -g "stale"
  • node ~/.gemini/antigravity-cli/brain/b733dbf7-85ea-4727-bda8-f5d09bdad6ee/scratch/drive_live.cjs
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Add newest-first cursor pagination to GET /api/db-tools/backups and GET /api/settings/google-drive/backups, probe SQLite schema versions only for returned local backup page entries, and load local and Google Drive backup history in Settings -> Database with initial 5-item pages, independent 10-item Load more actions, and recoverable error states.
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: FreeOpenSourcePOS/FloCafe/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 441225ab-ced2-47b3-a9c9-0474bab75834

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@khaira777

Copy link
Copy Markdown
Contributor Author

@greptileai review this at apex

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Adds independent pagination for local and Google Drive backup history: 5 initial rows, followed by batches of 10.

  • Local and Drive backup histories load older entries a page at a time.

Diagram

sequenceDiagram
  participant U as User
  participant H as Backup history
  participant A as Backup API
  U->>H: Load more
  H->>A: Request older page
  U->>H: Refresh
  H->>H: Advance request generation
  H->>A: Request newest 5
  A-->>H: Newest page
  H->>H: Replace rows and cursor
  A-->>H: Older page
  H->>H: Ignore outdated reply
Loading

Reviews (2) · Last reviewed commit: "fix(backups): ignore stale load-more res..." · Reviewed by Greptile

…efresh

Track request generations for local and Google Drive backup history so refreshing invalidates in-flight older-page requests and prevents skipped rows.
@khaira777 khaira777 changed the title feat: paginate local and Google Drive backup history feat: paginate local and Drive backup history Oct 21, 2026
@khaira777

Copy link
Copy Markdown
Contributor Author

@greptileai review this at apex

@khaira777
khaira777 merged commit 0d4899c into main Oct 21, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/ship-1158-backup-pagination branch October 21, 2026 19:26
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.

feat(backups): paginate local and Drive backup history

1 participant