Skip to content

BUG-130 - Harden RC1 Hot-Path Worker And Metadata Edges

Summary

Fix the concrete RC1 stabilization findings selected from the final C++ hot-path and memory-safety review. The fixes focus on UI-thread ownership, helper-worker state repair, REST polling cost, and corrupt local metadata handling.

Findings Addressed

  • qBit torrent-info compatibility walked the UI-owned download queue directly from a web worker.
  • Part-file helper launch failures could leave PFOP_* set even though no worker would ever clear it.
  • Upload disk read dispatch handled MFC low-memory exceptions but not standard allocation failures from STL/new paths.
  • File completion allocated its UI-thread success result after the file move and metadata delete phase.
  • /transfers and /upload-queue paged responses still serialized full lists before slicing.
  • Startup cache and known.met count fields could drive oversized allocations before the malformed metadata path rejected them.

Acceptance Criteria

  • [x] qBit torrent-info queue snapshots are dispatched through the REST UI bridge.
  • [x] Part-file helper launch failures clear their file-op flags on the failure path.
  • [x] Upload read dispatch unwinds raw pointer, pending count, and file-reference state for MFC and standard low-memory failures.
  • [x] File completion prepares its success handoff before destructive filesystem cleanup and repairs state on low-memory worker exits.
  • [x] REST transfer and upload queue paging happens during the list walk.
  • [x] Startup cache, duplicate-path cache, and known.met reject impossible counts before large allocation paths.

Implementation Evidence

  • b323c476 BUG-130 dispatch qBit queue snapshots on UI thread
  • 05e6186b BUG-130 clear file ops on helper launch failure
  • 3808eed3 BUG-130 clean upload read allocation failures
  • 56f67d62 BUG-130 harden completion worker low-memory exits
  • 07e8eae2 BUG-130 page REST hot-path lists during traversal
  • 06e8a12d BUG-130 reject oversized startup metadata counts

Validation Evidence

  • git diff --check
  • Debug and Release x64 app builds through python -m emule_workspace build app after each granular app commit.