Commit 01c8614
committed
Volume move (cross-volume) uses transfer driver
- `move_volumes_with_progress` (cross-volume copy+delete) delegates the per-iter scaffolding (cancellation check, pre-skip, conflict detect + dispatch, skip accounting, paired progress emit) to `drive_transfer_serial_async`. The closure body owns the per-source work: probe is-dir once, `copy_single_path` with `no_progress`, then `source_volume.delete` (or `delete_volume_path_recursive` for directory sources). On failure, the captured `VolumeError + path` is stashed in a Mutex cell so the post-loop branch can reconstruct a `WriteFailure` with full provider-enriched friendly-error context.
- Post-loop branch matches `outcome.intent`: `Completed` emits `write-complete`; `Cancelled` emits `write-cancelled` (preserving the M1.5 latent-bug fix for the cross-volume cancel path) plus returns `Err(Cancelled)`; `Failed(err)` reconstructs the `WriteFailure` with or without volume context.
- Throttled per-source progress emit added inside the transfer closure. Necessary because move passes `no_progress` to `copy_single_path` (move tracks no per-byte progress; `total_bytes = 0`); without an emit per successful source, test sinks that observe `emit_progress` events to trip a cancel hook (`cross_volume_move_cancel_mid_batch_preserves_completed`) would never see any event.
- Driver-owned bulk-skip prelude replaces the inline one (`build_pre_skip_set` from the driver). Move passes `bulk_skip_bytes = 0` because it has no scan phase to populate size hints. `ConflictDecisionInput`'s `source_size_hint` stays `None` per the legacy shape (move never had source-size hints either).
- All 13 existing `volume_move` tests pass without modification: cross-volume happy/skip/overwrite/stop/pre-known-bulk-skip/cancel-between/cancel-mid-batch + real-FS smoke + same-volume happy/skip/overwrite/cancel/pre-known-bulk-skip.
Same `'static`-bounded captures shape as `copy_volumes_with_progress` (config + operation_id cloned, events transmuted) to satisfy the driver's `for<'a> FnMut(...) -> Pin<Box<dyn Future + Send + 'a>>` bound. Sound because the closures don't outlive the driver `.await`.1 parent 101e838 commit 01c8614
1 file changed
Lines changed: 294 additions & 237 deletions
0 commit comments