Commit 5cf1173
committed
Volume move: direct unit tests + write-cancelled fix
- Add `volume_move_tests.rs` driving `move_volumes_with_progress` (cross-volume) and `move_within_same_volume_with_progress` (same-volume) directly via `CollectorEventSink` + `InMemoryVolume`. 13 tests mirror the `volume_copy_tests.rs` patterns: happy path, conflict + Skip/Overwrite/Stop, pre-known-conflict bulk-skip (data-safety: closure never invoked for bulk-skipped sources), per-iter skip accounting, cross-volume cancel between sources, cancel mid-batch invariant (each path is at exactly one of source/dest, never both, never neither), and a real-FS smoke against `LocalPosixVolume`.
- Fix latent bug: both inner functions returned `Err(Cancelled)` on cancel but never emitted `write-cancelled`. The outer wrapper's `Err(Cancelled)` arm only logs (to avoid double-emitting `write-error`), so the FE never saw the cancel and the progress dialog would stay open. Now mirrors `copy_volumes_with_progress`: emits a `WriteCancelledEvent` with `rolled_back: false` before returning. The CLAUDE.md "move_* inner handlers already emit write-cancelled" claim is now accurate.
- M1 step 4 of the transfer-driver refactor (see `docs/specs/transfer-driver-refactor-plan.md`).1 parent 1280056 commit 5cf1173
2 files changed
Lines changed: 781 additions & 3 deletions
Lines changed: 28 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
217 | 229 | | |
218 | 230 | | |
219 | 231 | | |
| |||
551 | 563 | | |
552 | 564 | | |
553 | 565 | | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
554 | 575 | | |
555 | 576 | | |
556 | 577 | | |
| |||
676 | 697 | | |
677 | 698 | | |
678 | 699 | | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
0 commit comments