Repository navigation
feat(update): time left during an update download, notices for slow or interrupted transfers - #8
Merged
Merged
Conversation
…n slow or interrupted transfers The download status showed percent and size only, so a slow transfer was hard to tell from a stuck one, and a transfer that dropped showed the same notice as any other failure. The updater now measures the transfer rate over the most recent progress reports and carries an estimate of the time left. The About status line and the install scope page append it to the progress caption. When a download has run for a while and the estimate is still long, a second line states that the speed depends on the connection to the download servers and that the download is still running; the About status area grows to fit it. A failure during the transfer itself now shows its own notice, which also says that the browser download uses the same servers. Other failures keep the existing notice.
This branch was successfully deployed
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.
Cause
The update download status showed percent and size only. A slow transfer was hard to tell from a stuck one, and a transfer that dropped or stalled showed the same notice as any other failure, although the release page it opens serves the file from the same servers.
Change
lib/update/updater.dart:DownloadRatemeasures the rate over the most recent progress reports;DownloadProgresscarries the estimated time left and a slow flag (set once the download has run 20 seconds with more than 2 minutes left, kept for the rest of that download).failedInDownloadtells a failure during the transfer from a missing listing or a refused apply.lib/settings/update_download_text.dart: one caption builder shared by the About status line and the install scope page.lib/settings/settings_app.dart: the About status area has a 22px minimum and grows, animated, for the slow-download line and the two-sentence download failure notice.lib/settings/install_scope_page.dart: same caption and slow-download line.lib/l10n: five new strings in English and Traditional Chinese.Verification
flutter analyzeand the fullflutter testsuite pass on macOS, including new tests for the rate estimate, the slow flag, the failure flag, the caption and the scope page line.