Skip to content

Workflow status is tracked in GitHub: https://github.com/emulebb/emulebb/issues/22. This local document is retained as an engineering spec/evidence record.

REF-042 - Consolidate WinInet Download Helpers And Review URL Shortcut Intake

Summary

Keep the existing WinInet download paths for the current release, but plan a future consolidation pass. The app now has hardened direct-download ownership, timeouts, and cancellation behavior, yet several callers still expose the same basic network-download pattern through separate local entry points.

This item should unify those helper paths only after the current release line is stable. It is not a beta 0.7.3 gate.

Current State

Relevant surfaces to revalidate before implementation:

  • DirectDownload and its WinInet handle/cancellation ownership.
  • GeoLocation and IPFilter refresh downloads, including temporary-file promotion and shutdown cancellation.
  • Server-list, IP-filter, or update-style download flows that still carry local WinInet setup, validation, or cleanup logic.
  • .url / Internet Shortcut drop intake from DropTarget.cpp. This path is kept for compatibility, but should be reviewed later for strict scheme, parsing, and local-file handling boundaries.

Intended Scope

  • Keep successful download behavior and proxy behavior unchanged.
  • Prefer one owned download helper with a clear timeout, cancellation, and handle-closing contract.
  • Preserve caller-specific validation and atomic promotion rules; do not flatten every update flow into a single post-download policy.
  • Review .url intake as compatibility input, not as a new rich-content parser.

Out of Scope

  • Replacing WinInet with a new HTTP stack in the same slice.
  • Reopening the removed MSHTML/rich drag-drop parser.
  • Adding new remote-update product behavior.
  • Changing REST/controller download semantics.

Acceptance Criteria

  • Common WinInet setup, timeout, cancellation, and close ownership are expressed through one small helper or wrapper.
  • GeoLocation and IPFilter refreshes still cancel cleanly during shutdown.
  • Failed downloads preserve the previous live data files.
  • .url intake accepts only the intended safe link forms and does not revive HTML/rich parsing.
  • Targeted tests cover at least one successful download, one cancellation or timeout path, one failed-promotion path, and one .url intake boundary.

Test Plan

  • Run focused direct-download and refresh-worker tests through the supported workspace CLI.
  • Run Release x64 app build after implementation.
  • If .url behavior changes, add a narrow parser/intake regression test before touching UI drag/drop behavior.