Skip to content

Fix frozen download progress after a retry - #885

Open
mahadshahib wants to merge 1 commit into
XcodesOrg:mainfrom
mahadshahib:fix/download-progress-after-retry
Open

mahadshahib wants to merge 1 commit into
XcodesOrg:mainfrom
mahadshahib:fix/download-progress-after-retry

Conversation

@mahadshahib

Copy link
Copy Markdown
Contributor

When a URLSession download retries with resume data, it supplies a new Progress while the installation remains in .downloading. ObservingProgressIndicator retains its ProgressWrapper in @StateObject, so an unchanged view identity keeps observing the previous task. The percentage and byte count can freeze even though the replacement task continues downloading.

Tie each download indicator's identity to ObjectIdentifier(progress) in the Xcode detail pane, sidebar row, and runtime detail pane. Replacing the task now creates an observer for its progress; updates to the same task keep the existing view identity.

Add regression tests that render each affected view with progress at 6%, replace the progress object with one at 75%, and assert that the native indicator displays 75%.

Validation:

  • Standalone SwiftUI reproduction confirms the original StateObject behavior and the identity fix.
  • git diff --check and project-file validation pass.
  • Full macOS test suite: 54 tests passed, 0 failures, including all three new regression tests, using Xcode 26.6 and xcodebuild test -scheme Xcodes -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO.

Local validation used a temporary link from Xcode's default DerivedData directory to the custom build directory so the existing acknowledgements generator could locate package checkouts. The link was removed after testing; generated license changes are excluded.

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.

1 participant