fix(backup): verify scheduled export destinations before writing

This commit is contained in:
Melody Ruch authored and GitHub committed 2026-08-17 12:41:26 +08:00
1 parent a8f966dcfd
commit 4ce27f8ae5
12 files changed
+652 -7

No files matched your search

+13
View File
@@ -65,3 +65,16 @@ pub async fn cancel_database_export(export_id: String) -> Result<(), String> {
dbx_core::database_export::set_export_cancelled(&export_id).await;
Ok(())
}
/// Records a scheduled backup destination's filesystem identity as soon as
/// the schedule is saved, not just after its first successful export. See
/// `record_export_destination_identity` for why this eager recording is
/// needed. Called from the schedule editor when a schedule is created or
/// edited (`apps/desktop/src/components/backup/ScheduledDatabaseBackupSettings.vue`).
#[tauri::command]
pub async fn record_database_export_destination(
state: State<'_, Arc<AppState>>,
directory: String,
) -> Result<(), String> {
dbx_core::database_export::record_export_destination_identity(&state, std::path::Path::new(&directory)).await
}
+1
View File
@@ -2233,6 +2233,7 @@ pub fn run() {
commands::database_export::begin_database_backup_snapshot,
commands::database_export::export_database_sql,
commands::database_export::cancel_database_export,
commands::database_export::record_database_export_destination,
commands::table_export::start_table_export,
commands::table_export::cancel_table_export,
commands::query_result_export::start_query_result_export,