Skip to content

feat: pause and resume running file operations - #146

Merged
nextestudios merged 2 commits into
mainfrom
feature/21-pause-resume
Sep 27, 2026
Merged

nextestudios merged 2 commits into
mainfrom
feature/21-pause-resume

Conversation

@nextestudios

Copy link
Copy Markdown
Owner

Summary

  • PauseGate (Core): cooperative pause; WaitIfPausedAsync honors cancellation.
  • FileOperationRequest.Pause: the engine waits at safe points — before each item (delete, copy/move, inside folders) and before each 80 KB block of a file being copied. A paused copy keeps only its hidden .controlfs-copy-*.part temp (journaled), nothing half-written in the destination.
  • Capability-based: OperationQueue.Enqueue(..., pausable: true) is used only for copy/move/delete. Extraction and compression don't get a gate, so CanPause is false and Pause never appears.
  • OperationQueue.Pause/Resume use the existing Paused state of OperationStateMachine; cancel works while paused (no resume needed). A conflict asked right before a pause no longer flips the state back to Running.
  • Menu → Operations → operation → Pausar / Continuar; status bar shows "pausada". The queue stays serial: later operations wait for the paused one. No resume after restart.

Tests

CI (Windows):

  • FileOperationServiceTests: pausing mid-file stops writing (no progress for 1 s, no destination file), resuming finishes a byte-identical copy with no temps; cancelling while paused removes the partial copy.
  • PauseJourneyTests: pause/resume through the Operations menu; paused engine doesn't touch the destination; non-pausable operations can't be paused.

Manual (docs/TESTING.md): disk activity really stops within ~1 s on a slow USB drive; cancel after pause; extraction/compression show no Pause.

Closes #21

🤖 Generated with Claude Code

@nextestudios
nextestudios force-pushed the feature/21-pause-resume branch 2 times, most recently from 9b1e783 to 4a1684e Compare September 27, 2026 05:26
nextestudios and others added 2 commits September 27, 2026 02:28
Add a cooperative PauseGate that the file operation engine honors between
items and between blocks of a file being copied. Only pausable engines
get a gate, so Pause is hidden (never simulated) for extraction and
compression. Resume continues from the current item and cancel still
works while paused, removing the partial copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nextestudios
nextestudios force-pushed the feature/21-pause-resume branch from 4a1684e to ef8a7d8 Compare September 27, 2026 05:28
@nextestudios
nextestudios merged commit 53e36b3 into main Sep 27, 2026
1 check passed
@nextestudios
nextestudios deleted the feature/21-pause-resume branch September 27, 2026 05:31
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.

feat: pause and resume running file operations

1 participant