Background refresh completion can wedge when UI PostMessage fails
Summary¶
GeoLocation and IPFilter background refresh workers clear their in-progress
flags only when a UI completion message is delivered. Worker cleanup ignores
PostMessage failure, so a destroyed window, full message queue, or other post
failure can leave refresh state permanently stuck.
This blocks Beta 0.7.3 because the current fix for stuck refresh flags does not cover lost completion delivery.
Evidence¶
srchybrid/GeoLocation.cpp:763setsm_bBackgroundRefreshQueuedbefore starting the worker.srchybrid/GeoLocation.cpp:782clears the flag only in the UI completion handler.srchybrid/GeoLocation.cpp:1022discards thePostMessageresult.srchybrid/IPFilterUpdater.cpp:367setsm_bBackgroundRefreshQueuedbefore starting the worker.srchybrid/IPFilterUpdater.cpp:384clears the flag only in the UI completion handler.srchybrid/IPFilterUpdater.cpp:424discards thePostMessageresult.
Execution Plan¶
- Revalidate refresh object lifetime during normal runtime and application shutdown.
- Decide whether failed completion posts should synchronously clear state, enqueue a fallback, or transition to a terminal shutdown state.
- Make completion delivery explicit: successful UI post means UI owns final state transition; failed post means worker or owner records terminal cleanup.
- Check
ResumeThreadfailure and ensure a never-started worker cannot leave refresh queued. - Add focused seams for failed
PostMessage, destroyed notify window, andResumeThreadfailure. - Verify manual and automatic refresh still serialize correctly.
Acceptance Criteria¶
- GeoLocation refresh cannot remain queued solely because completion posting failed.
- IPFilter refresh cannot remain queued solely because completion posting failed.
- Shutdown behavior is deterministic and does not post to invalid windows.
- Existing successful refresh behavior is unchanged.
Validation¶
- 2026-05-08: Done in app commit
1a09692. python -m emule_workspace build app --workspace-root . --config Release --platform x64 --variant mainpassed; log rootworkspaces\v0.72a\state\build-logs\20260508-095344.python -m emule_workspace build tests --workspace-root . --config Release --platform x64 --test-run-variant mainpassed; log rootworkspaces\v0.72a\state\build-logs\20260508-095409.python -m emule_workspace validate --workspace-root .passed.- Focused doctest passed:
repos\emulebb-build-tests\build\eMulebb-workspace-v0.72a-eMule-main\x64\Release\emule-tests.exe --test-suite=parity --test-case="IP-filter update seam detects due automatic refreshes". - Code validation: GeoLocation and IPFilter refresh queued state is now interlocked, failed UI posts fall back to synchronous delivery when the window is valid, and unavailable windows clear the queued flag instead of wedging the refresh state.