Slice 3: Thread cancel_event explicitly through download chain #39

Closed
opened 2026-06-05 18:11:05 +02:00 by AlexKucera · 1 comment
AlexKucera commented 2026-06-05 18:11:05 +02:00 (Migrated from github.com)

Parent

#36 — PRD-003: Deepen Codebase Architecture

What to build

Stop threading cancel_event through the progress reporter as a shared-state bag. Instead, pass it explicitly through the parameter chain: sync_run closure → download_book() → download_m4b()/download_zip_part() (which already accept it). Remove the cancel_event attribute from both reporter classes.

Acceptance criteria

  • cancel_event is removed from PlainTextReporter and ProgressReporter
  • reporter.cancel_event = ... assignment is removed from sync_run.py
  • download_book() accepts and forwards cancel_event to its streaming calls
  • All existing cooperative cancellation tests pass (orchestrator Ctrl+C drain tests)
  • Full test suite passes
  • The progress reporter's public interface no longer includes any cancellation-related attributes

Blocked by

None - can start immediately

## Parent #36 — PRD-003: Deepen Codebase Architecture ## What to build Stop threading `cancel_event` through the progress reporter as a shared-state bag. Instead, pass it explicitly through the parameter chain: sync_run closure → download_book() → download_m4b()/download_zip_part() (which already accept it). Remove the `cancel_event` attribute from both reporter classes. ## Acceptance criteria - [ ] `cancel_event` is removed from `PlainTextReporter` and `ProgressReporter` - [ ] `reporter.cancel_event = ...` assignment is removed from `sync_run.py` - [ ] `download_book()` accepts and forwards `cancel_event` to its streaming calls - [ ] All existing cooperative cancellation tests pass (orchestrator Ctrl+C drain tests) - [ ] Full test suite passes - [ ] The progress reporter's public interface no longer includes any cancellation-related attributes ## Blocked by None - can start immediately
AlexKucera commented 2026-06-05 18:45:36 +02:00 (Migrated from github.com)

✅ Issue #39 Complete — removed from both reporter classes, now threaded explicitly through parameter chain ( → download_book() → streaming calls). 429 tests (+5 net), all pass. 6/6 AC met.

✅ **Issue #39 Complete** — removed from both reporter classes, now threaded explicitly through parameter chain ( → `download_book()` → streaming calls). 429 tests (+5 net), all pass. 6/6 AC met.
Sign in to join this conversation.