Commit e21ca6d
committed
Bugfix: MTP delete emits
The volume-delete file loop's `?` propagation of `VolumeError::Cancelled` from `delete_with_cancel` mapped to `WriteOperationError::Cancelled` and exited the function without emitting `write-cancelled`. The top-of-loop check only catches cancels that land between iterations; a cancel that arrives during the in-flight per-file call dropped the terminal event, leaving the M4 settle contract incomplete (FE got `write-settled` but no `write-cancelled`, so the dialog waited 10 s for the fallback timer).
- Explicit `match` on `delete_with_cancel`'s result handles `VolumeError::Cancelled` by emitting `write-cancelled` before returning, and maps every other error as before.
- Adds an E2E throttle hook (`effective_copy_throttle_ms`) in the delete loop so cancel-during-delete tests on fast virtual MTP have a deterministic window. Zero-cost outside E2E mode.
- `mtp-cancel-volume-settled` spec sets a 200 ms throttle before F8 (clears in `finally`) so the cancel reliably lands while the BE is still in the delete loop, exercising the new mid-iteration emit path.
End-to-end verified: Linux Docker e2e 157/157 (was 153/4), macOS playwright e2e 145/145.write-cancelled on mid-iteration cancel1 parent 0752861 commit e21ca6d
2 files changed
Lines changed: 47 additions & 3 deletions
File tree
- apps/desktop
- src-tauri/src/file_system/write_operations
- test/e2e-playwright
Lines changed: 32 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
714 | 714 | | |
715 | 715 | | |
716 | 716 | | |
717 | | - | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
718 | 728 | | |
719 | 729 | | |
720 | | - | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
721 | 750 | | |
722 | 751 | | |
723 | 752 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
111 | 122 | | |
112 | 123 | | |
113 | 124 | | |
| |||
255 | 266 | | |
256 | 267 | | |
257 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
258 | 273 | | |
259 | 274 | | |
260 | 275 | | |
| |||
0 commit comments