Repository navigation
Conversation
async 版の URLSession.download(for:delegate:) は URLSessionDownloadDelegate の didWriteData を呼ばないため,進捗が一度も届かずバーが動いていなかった. 作られたタスクの task.progress を KVO で監視する方式に変える. - サイズ不明の判定は旧実装と同じく,応答の予定サイズ(countOfBytesExpectedToReceive)で行う - 通知の順序は保証されないので,進捗は増える方向にだけ反映し,1% 未満の変化は間引く - テスト用に保存先フォルダを差し替えられるようにし,進捗の報告と DMG の保存を確かめるテストを追加
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
概要
アップデートのダウンロード中に進捗バーが動かない不具合を修正します.
async 版の
URLSession.download(for:delegate:)はURLSessionDownloadDelegateのdidWriteDataを呼ばないため,進捗が一度も届いていませんでした.作られたタスクのtask.progressを KVO で監視する方式に変えています.変更点
UpdateDownloadProgressをURLSessionTaskDelegateにし,didCreateTaskでtask.progress.fractionCompletedを監視countOfBytesExpectedToReceive > 0で行う(不明のときはスピナー表示)applyProgress)AppUpdaterにdownloadsDirectoryを追加し,テストで保存先を差し替え可能にpresentsWindows == falseのときは完了後に Finder で表示しないテスト
downloadReportsProgressAndSavesDMGを追加(2回に分けて返すモックで,進捗の報告・保存先・中身の一致を確認)AppUpdaterTests7件すべて成功未確認