Skip to content

fix(frontend): download SQLite backup/export in web mode (#688)#703

Open
AtomicTrxn wants to merge 2 commits intoafadil:mainfrom
AtomicTrxn:codex/fix-688-web-backup-download
Open

fix(frontend): download SQLite backup/export in web mode (#688)#703
AtomicTrxn wants to merge 2 commits intoafadil:mainfrom
AtomicTrxn:codex/fix-688-web-backup-download

Conversation

@AtomicTrxn
Copy link
Contributor

@AtomicTrxn AtomicTrxn commented Mar 10, 2026

Description

Fixes self-hosted web backup/export flow for SQLite so users receive a browser download instead of only a server-side filename.

Root cause:

  • Web backup_database already returned { filename, data } from backend.
  • Frontend web paths (useExportData and useBackupRestore) ignored data and treated result as server-only save.

Fix summary:

  • Web SQLite paths now call openFileSaveDialog(data, filename) and treat success as local save.
  • Updated web backup/export copy to match actual behavior.
  • Added regression tests for both hooks covering web SQLite download behavior.
  • Includes rustfmt baseline fix for unrelated upstream file (crates/core/src/addons/tests.rs) to satisfy current Rust Check gate.

Note: Backend/API unchanged (POST /utilities/database/backup already returns data and filename).

Test Evidence

  • cargo fmt --all -- --check
  • pnpm --filter frontend test -- use-export-data
  • pnpm --filter frontend test -- use-backup-restore
  • pnpm run build:types && pnpm --filter frontend type-check

Fixes #688

Checklist

By submitting this PR, I agree to the CLA.

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.

[Bug?] Self-hosted data export only saves on server

1 participant