Skip to content

Conversation

@CalebRas
Copy link
Collaborator

@CalebRas CalebRas commented Dec 4, 2025

Description

This PR fixes some issues with the Download Offline Resources page:

  • A crash when retrying failed downloads. e8190d4
  • A bug where the "Download All" button would not re-enable if any downloads failed.
  • A bug where multiple download-all operations would start when scrolling to and from the "Download All" button. 36363c5
  • A bug where the "Download All" button's progress view would disappear after scrolling away from the button. 11be7c4
    • This was a SwiftUI bug that I worked around by making the download-all progress view also use GaugeProgressViewStyle.
  • A hang when tapping "Done" after "Download All". 2f680d4
    • This appears to be an NSBundleResourceRequest bug that causes presentations to hang when downloading resources, even when downloading on a background thread. I could not find a way to work around this, so I removed the alert, which was confusing anyway. I updated the "Done" button show "Cancel" when there are in-progress downloads instead.
  • A crash that occasionally happened during downloading.
    • This appears to be a race condition that would happen when a ProgressView accessed a dellocated Progress instance. To work around this, I changed OnDemandResource.progress to an object that gets manually updated from request.progress during downloading. 7c6b39b
  • Some other minor code issues. 293450a

Linked Issue(s)

  • swift/issues/7572

How To Test

Ensure the above-mentioned issues are no longer present.

  • To simulate live downloads, set Embed Asset Packs In Product Bundle to No under the Target Build Settings.
  • To simulate download errors, update the code to use invalid tags, such as by passing them in here, and try to download.

Screenshots

Before After
Simulator Screenshot - iPhone 17 Pro - 2025-12-03 at 16 45 48-2 Simulator Screenshot - iPhone 17 Pro - 2025-12-04 at 14 54 11-2

@CalebRas CalebRas self-assigned this Dec 4, 2025
@CalebRas
Copy link
Collaborator Author

CalebRas commented Dec 4, 2025

There is one crash I didn't fix that appears to happen somewhere in the SwiftUI ProgressView implementation when it accesses a deallocated Progress object. It is sporadic at best, so I could not get it reproducing reliably enough to find a workaround. I included the stack trace in the issue if you are curious. (Fixed)

@CalebRas CalebRas requested review from a team, chriswebb09 and zkline101 and removed request for a team December 5, 2025 00:00
@CalebRas
Copy link
Collaborator Author

CalebRas commented Dec 8, 2025

Hold off on reviewing this please. I may have found a fix for the Progress View crash.

@CalebRas
Copy link
Collaborator Author

CalebRas commented Dec 8, 2025

There is one crash I didn't fix that appears to happen somewhere in the SwiftUI ProgressView implementation when it accesses a deallocated Progress object. It is sporadic at best, so I could not get it reproducing reliably enough to find a workaround. I included the stack trace in the issue if you are curious.

Fixed. The description has been updated, and this PR is ready for review again.

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.

2 participants