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.
/transfersand/upload-queuepaged responses still serialized full lists before slicing.- Startup cache and
known.metcount 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.metreject impossible counts before large allocation paths.
Implementation Evidence¶
b323c476BUG-130 dispatch qBit queue snapshots on UI thread05e6186bBUG-130 clear file ops on helper launch failure3808eed3BUG-130 clean upload read allocation failures56f67d62BUG-130 harden completion worker low-memory exits07e8eae2BUG-130 page REST hot-path lists during traversal06e8a12dBUG-130 reject oversized startup metadata counts
Validation Evidence¶
git diff --check- Debug and Release x64 app builds through
python -m emule_workspace build appafter each granular app commit.