BUG-136 - Harden Final RC1 Review Follow-Up Hot Paths¶
Summary¶
Fix the concrete hot-path findings selected from the final RC1 C++ review pass. The fixes address shutdown null-safety and AICH close-awareness, stale Win32 timer callbacks, socket allocation cleanup, Arr search result lifetime and paging, and qBittorrent-compatible queue-cache invalidation after mutations.
Findings Addressed¶
- Shared-file shutdown abandonment could make later known-file save and
completion finalization dereference
theApp.sharedfilesafter it was deliberately nulled. - AICH sync could block indefinitely on
hashing_mutand prevent the UI thread from reaching the bounded shared-hash shutdown path. - Already-queued UPnP and server retry timer callbacks could act on newer state after their original timer was killed.
- Normal TCP accept and server connect still had low-memory allocation/list insertion paths that could escape handlers or leave connection state dirty.
- Arr-created native searches were stopped but not deleted, retaining native tabs/results, and REST search paging still collected every visible result before applying the requested page.
- qBittorrent-compatible transfer-info cache could return stale queue state immediately after successful qBit-visible mutations.
Acceptance Criteria¶
- [x] Known-file save and completion finalization are null-safe when shared-file ownership has been abandoned during shutdown.
- [x] AICH sync polls
hashing_mutand exits promptly once shutdown is observed. - [x] UPnP timeout and server retry callbacks validate the live timer id before dispatching.
- [x] TCP accept and server connect recover cleanly from client/server socket wrapper allocation or publication failure.
- [x] Arr-created searches are deleted after result collection, and Arr polling can request a bounded non-exact search result page.
- [x] qBit torrent-info cache is invalidated after successful add, delete, category, pause, stop, and resume mutations.
Implementation Evidence¶
074d67ceBUG-136 harden shutdown hash completion edges93a3b515BUG-136 ignore stale callback timerse5ae4272BUG-136 guard socket allocation failures1a018a37BUG-136 bound Arr search result lifetime84c45465BUG-136 invalidate qBit queue cache after mutations
Validation Evidence¶
git diff --check- Source normalization scan for touched app files.
- Debug x64 app build through
python -m emule_workspace build app --variant main --config Debug --platform x64 --build-output-mode ErrorsOnlyat20260529T104403Z-build-app. - Release x64 app build through
python -m emule_workspace build app --variant main --config Release --platform x64 --build-output-mode ErrorsOnlyat20260529T104432Z-build-app.