Merged
Conversation
Download original book files directly to temporary files instead of buffering the full response in memory. Route offline CBR, EPUB, and PDF downloads through the file streaming path and throttle download progress updates to avoid excessive Observation notifications.
Show a processing state once a pending offline task has finished the file transfer but still needs extraction or finalization.
Update offline task rows and Live Activity state after a file transfer reaches completion but extraction or finalization is still running. Add localized processing text for all supported app languages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Large original book downloads could buffer the full response in memory before writing to disk. CBR, EPUB, and PDF files can easily be hundreds of megabytes or larger, making macOS foreground downloads fragile and causing excessive progress notifications during high-throughput downloads.
After a file transfer completed, pending offline tasks and Live Activity state could also continue to display as
Downloading 100%while extraction or finalization was still running.Approach
Add a file-based download path in
APIClientthat usesURLSessionDownloadTaskto stream responses into a temporary file, then moves the completed file into place only after a successful HTTP response.BookService.downloadBookFilenow requires a destination URL, and offline CBR, EPUB, and PDF flows consume the downloaded file directly for extraction or storage.Progress updates are throttled in
DownloadProgressTrackerso Observation-driven UI refreshes stay at a human-scale cadence while still delivering start and completion states immediately. Offline task rows and Live Activity updates now switch from download progress to a localized processing state once transfer work is complete but offline preparation continues.Scope
DatabuffersValidation
make formatmake build-macosmake build