Skip to content

fix(apps): stabilize download batches and indeterminate progress - #638

Open
eolobinhooooooooooooooohhoooooo wants to merge 1 commit into
hellzerg:masterfrom
eolobinhooooooooooooooohhoooooo:fix/apps-download-batch-safety
Open

eolobinhooooooooooooooohhoooooo wants to merge 1 commit into
hellzerg:masterfrom
eolobinhooooooooooooooohhoooooo:fix/apps-download-batch-safety

Conversation

@eolobinhooooooooooooooohhoooooo

Copy link
Copy Markdown

Summary

Fix two Apps downloader failures: unknown-length responses can throw while updating progress, and refreshing the feed can replace the selection and enable a second batch during an active download.

Fixes #637.

Changes

  • Make feed refresh and download/install batches mutually exclusive, including event-handler guards rather than button state alone.
  • Capture selected app metadata, destination, architecture and auto-install choice before the first await. Keep those controls disabled until the batch finishes.
  • Handle missing/zero lengths before division and clamp known-length progress to 0–100 without string conversions.
  • Use WebClient's existing UI-context delivery instead of queueing progress updates again; ignore updates to disposed forms.
  • Preserve HTTP(S) validation, destination containment, atomic file promotion, temporary-file cleanup and the successful-download-only installer list.
  • Add isolated .NET Framework regression tests and a Windows CI workflow that builds the application and runs them.

Verification

  • Release and Debug application rebuilds passed with warnings treated as errors.
  • dotnet test Optimizer.Tests/Optimizer.Tests.csproj --configuration Release: 39 passed, 0 failed, 0 skipped.
  • A real chunked HTTP response, served only over loopback, exercises unknown-length progress on a Windows Forms synchronization context, cancellation and timeout cleanup. Downloaded bytes are inert fixture data.

The tests cover the production helpers and HTTP contract, not a full MainForm/installer end-to-end journey. Optimizer and real installers were not run, and no system settings were changed. Production dependencies and optimization behavior are unchanged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apps downloader crashes on unknown lengths and allows overlapping batches

1 participant