diff --git a/docs/updating.md b/docs/updating.md index 9cf86e7..2c771da 100644 --- a/docs/updating.md +++ b/docs/updating.md @@ -30,7 +30,8 @@ One `GET api.github.com/repos/{owner}/{repo}/releases/latest` (60 an hour per IP size and `digest: sha256:…`. Drafts and pre-releases are refused; a release not newer than the running version is never offered (no downgrade). The download uses that release's own URLs. -Two witnesses to the file, both over TLS: the workflow's `SHA256SUMS.txt` and GitHub's digest computed on +Two witnesses to the file, both over TLS: the workflow's `SHA256SUMS.txt` and, when GitHub gives one (it +computes it for every asset uploaded since 2025, this repository's included), its digest computed on upload. They must agree with each other and with the downloaded bytes, else the file is deleted. **What this does not defend against:** a compromised account or workflow — the hash proves the file is the one published, not that it is honest. Verifying the build attestation (Sigstore) inside the application was @@ -40,7 +41,13 @@ the Web, so SmartScreen does not see it: the hash is what vouches for it. TLS: rustls (through `ureq`), certificates checked against the OS's trust store (`rustls-platform-verifier`: a corporate proxy's own root is accepted like in a browser), Windows' proxy settings read -(`win-system-proxy`). A generic `User-Agent` with the version, nothing about the user. +(`win-system-proxy`). A generic `User-Agent` with the version, nothing about the user. The trade, said +plainly: a TLS-inspecting proxy whose root the machine trusts can replace both the checksums and the file, +and the hash then proves nothing against it — as for any download on that machine. + +GitHub allows 60 unauthenticated API requests an hour per IP address, shared by everyone behind it (a +household, an office, a carrier's NAT). A click-only check rarely comes near it; when it does, the window +says so and when the limit resets (`x-ratelimit-reset`), rather than "GitHub answered 403". ## The swap @@ -51,13 +58,22 @@ a separate process can rename it once it has exited: copy. Creating it is also the test that the folder can be written; a read-only folder (Program Files) fails here and the window offers the release page. 2. *Restart now* writes `updates\pending.txt` (the version being installed) in the data folder, starts a - hidden Windows PowerShell (`-NoProfile -NonInteractive -WindowStyle Hidden`, `CREATE_NO_WINDOW`) and - closes the window the normal way. -3. The script waits for this exact process (`Wait-Process -Id -Timeout 30`), removes an older `.old`, - renames `` to `.old` and `.new` to `` — each step retried up to 10 times, 0.5 s - apart, because OneDrive or an antivirus may hold a file just written — then starts ``. -4. On any failure, it writes the reason to `updates\result.txt`, puts `.old` back if `` is gone, - and starts the executable again. + hidden Windows PowerShell by its absolute path (`%SystemRoot%\System32\WindowsPowerShell\v1.0`, never + by name: Windows searches the application's own folder first, and a `powershell.exe` dropped in a + Downloads folder would run; winget likewise) with `-NoProfile -NonInteractive -WindowStyle Hidden` and + `CREATE_NO_WINDOW`, and closes the window the normal way. The window warns first when videos are in the + queue: the queue lives in memory and does not survive the restart. +3. The script waits for this process (`Wait-Process -Id -Timeout 30`, only while that id is still + this program by name: an id can be reused), removes an older `.old`, renames `` to `.old` + (retried 10 times, 0.5 s apart) and `.new` to `` (retried for 30 s: OneDrive may still be + uploading the new file — think of an executable on a Desktop that Windows 11 backs up), then starts + ``. If the application did not close in 30 s, nothing is touched and `result.txt` says so. +4. On any failure, each recovery step runs in its own `try`, restore first: if the old executable was + moved, the new one is set aside (back to `.new`) and the old one put back (retried); then the executable + in place is started; `result.txt` is written last, so failing to write it never skips the restore. A new + executable that is in place but refuses to start (an antivirus) is set aside the same way. The script a + version carries is the one that installs the next: these paths were reviewed by GameModeExecutor's + session on 2026-11-24, before 1.1.0 froze them. 5. The next start compares `pending.txt` with its own version: equal, *Updated to X* and the `.old` goes; different, the failure and `result.txt`'s reason, and the unused `.new` goes. A `.new` left without a pending update (a download never installed) is deleted at start. @@ -84,8 +100,21 @@ newer: | *Restart now* | the window closed; the swap left `quick-video-transcoder.exe` with the published 1.0.0's SHA-256 (`a55a5f19…05ee02`) and the debug build as `.old`; 1.0.0 started and came to the foreground | | Rollback | the same, with `.old` held open by another process: the removal failed ten times, the catch wrote *The process cannot access the file…* to `result.txt`, the executable stayed in place and restarted, and its next start showed the failure and the reason | +After the review's changes, 2026-11-24, the same way (`review test [it's]`): + +| Case | Result | +| --- | --- | +| Normal update | 1.0.0 in place (`a55a5f19…`), the previous build as `.old`, 1.0.0 running | +| The new file refuses to start (the verified download replaced by a non-program just before *Restart now*) | `Start-Process` failed (*not a valid application for this OS platform*); the script set the new file aside, put the old executable back, started it; the next start showed the reason and deleted the rejected file — no `.old`, no `.new` left | + Not measured: behind a proxy; the *Updated to* message from a real release pair (1.0.0 does not read -`pending.txt` — it waits for 1.1.0 → 1.2.0); OneDrive's locks (the retries are there for them). +`pending.txt` — it waits for 1.1.0 → 1.2.0); OneDrive's locks (the retries are there for them); the +focus after a slow close (near the 30 s wait, the window may only flash in the taskbar). + +Known rare cases, left as they are: a second window (when the single instance could not be claimed) still +running the old image keeps `.old` held, and the next update fails safely until it is closed; that second +window's start may also delete a download the first one is making (`settle` tidies a `.new` with no pending +update), and the swap then fails safely. ## Files written diff --git a/i18n/en/quick_video_transcoder.ftl b/i18n/en/quick_video_transcoder.ftl index 0f03db9..a280ae9 100644 --- a/i18n/en/quick_video_transcoder.ftl +++ b/i18n/en/quick_video_transcoder.ftl @@ -633,3 +633,17 @@ update-fault-not-verified = The downloaded file does not match the published one update-fault-cannot-write = This copy's folder cannot be written. Download the new version from the release page instead. # $detail: why the install failed (technical, English: a Windows or PowerShell message). update-fault-install = The update could not be installed: { $detail } +# GitHub refused because its hourly limit (60 checks per internet connection, shared by everyone on it) is +# reached. $minutes: minutes until it resets. +update-fault-rate-limited = + GitHub limits checks to 60 an hour per internet connection, and that limit is reached. Try again in { $minutes -> + [one] { NUM($minutes) } minute + *[other] { NUM($minutes) } minutes + }. +update-fault-rate-limited-later = GitHub limits checks to 60 an hour per internet connection, and that limit is reached. Try again later. +# Under Restart now when videos are in the queue: the queue is not kept across the restart. +update-queue-cleared = + Restarting clears the queue ({ $count -> + [one] { NUM($count) } video + *[other] { NUM($count) } videos + }): their trims and settings are not kept. diff --git a/i18n/fr/quick_video_transcoder.ftl b/i18n/fr/quick_video_transcoder.ftl index d7eecd1..75152d7 100644 --- a/i18n/fr/quick_video_transcoder.ftl +++ b/i18n/fr/quick_video_transcoder.ftl @@ -467,3 +467,14 @@ update-fault-unexpected = La réponse de GitHub ne correspond pas à ce que cett update-fault-not-verified = Le fichier téléchargé ne correspond pas au fichier publié : il a été supprimé. Réessayez. update-fault-cannot-write = Le dossier de cette copie n’est pas modifiable. Téléchargez plutôt la nouvelle version depuis sa page. update-fault-install = La mise à jour n’a pas pu être installée : { $detail } +update-fault-rate-limited = + GitHub limite les vérifications à 60 par heure et par connexion Internet, et cette limite est atteinte. Réessayez dans { $minutes -> + [one] { NUM($minutes) } minute + *[other] { NUM($minutes) } minutes + }. +update-fault-rate-limited-later = GitHub limite les vérifications à 60 par heure et par connexion Internet, et cette limite est atteinte. Réessayez plus tard. +update-queue-cleared = + Le redémarrage vide la file d’attente ({ $count -> + [one] { NUM($count) } vidéo + *[other] { NUM($count) } vidéos + }) : les découpes et réglages ne sont pas conservés. diff --git a/src/app/mod.rs b/src/app/mod.rs index 9ce8d95..df9a1ee 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -1211,7 +1211,7 @@ impl eframe::App for TranscoderApp { self.profiles_window(&ctx); self.about_window(&ctx); self.update_window(&ctx); - if self.close_for_update { + if std::mem::take(&mut self.close_for_update) { ctx.send_viewport_cmd(egui::ViewportCommand::Close); } self.ffmpeg_window(&ctx); diff --git a/src/app/update_window.rs b/src/app/update_window.rs index db51c4f..04212ae 100644 --- a/src/app/update_window.rs +++ b/src/app/update_window.rs @@ -152,6 +152,7 @@ impl TranscoderApp { let mut open = true; let mut event = None; let encoding = self.encoding(); + let queued = self.queue.jobs.len(); let phase = self.updater.machine.phase().clone(); egui::Window::new(crate::tr!("update-title")) .id(egui::Id::unique("update window")) @@ -166,7 +167,7 @@ impl TranscoderApp { version = running_version().to_string() )); ui.add_space(8.0); - event = phase_ui(ui, &phase, encoding); + event = phase_ui(ui, &phase, encoding, queued); }); if let Some(event) = event { self.send_update(event); @@ -179,7 +180,7 @@ impl TranscoderApp { } /// The body of the window for a phase; returns the event a button sent. -fn phase_ui(ui: &mut egui::Ui, phase: &Phase, encoding: bool) -> Option { +fn phase_ui(ui: &mut egui::Ui, phase: &Phase, encoding: bool, queued: usize) -> Option { let mut event = None; match phase { Phase::Idle => { @@ -243,6 +244,16 @@ fn phase_ui(ui: &mut egui::Ui, phase: &Phase, encoding: bool) -> Option { .small() .weak(), ); + } else if queued > 0 { + // The queue lives in memory only: trims and settings of queued videos are not kept. + ui.label( + egui::RichText::new(crate::tr!( + "update-queue-cleared", + count = (queued as f64) + )) + .small() + .color(ui.visuals().warn_fg_color), + ); } if restart.clicked() { event = Some(Event::RestartAsked); @@ -355,6 +366,10 @@ fn fault_text(fault: &Fault) -> String { match fault { Fault::NoConnection(_) => crate::tr!("update-fault-connection"), Fault::Status(status) => crate::tr!("update-fault-status", status = status.to_string()), + Fault::RateLimited(Some(minutes)) => { + crate::tr!("update-fault-rate-limited", minutes = (*minutes as f64)) + } + Fault::RateLimited(None) => crate::tr!("update-fault-rate-limited-later"), Fault::Unexpected(_) => crate::tr!("update-fault-unexpected"), Fault::NotVerified => crate::tr!("update-fault-not-verified"), Fault::CannotWrite(_) => crate::tr!("update-fault-cannot-write"), diff --git a/src/ffmpeg/mod.rs b/src/ffmpeg/mod.rs index cb572f5..f3ea213 100644 --- a/src/ffmpeg/mod.rs +++ b/src/ffmpeg/mod.rs @@ -32,6 +32,29 @@ const CREATE_NO_WINDOW: u32 = 0x0800_0000; /// The `PATH` read from the settings by [`refresh_path`], when the inherited one lacks FFmpeg. static FRESH_PATH: RwLock> = RwLock::new(None); +/// Windows PowerShell by its absolute path, without a console window. Never looked up by name: Windows +/// searches the application's own folder before System32, so a `powershell.exe` dropped beside this +/// executable (a Downloads folder) would run instead (found in review, 2026-11-24). +pub fn powershell() -> Command { + let root = std::env::var_os("SystemRoot").unwrap_or_else(|| "C:\\Windows".into()); + let path = std::path::Path::new(&root) + .join("System32") + .join("WindowsPowerShell") + .join("v1.0") + .join("powershell.exe"); + tool(&path.to_string_lossy()) +} + +/// winget by its absolute path (the App Installer's alias in the user's WindowsApps folder), for the +/// same reason as [`powershell`]. `None` when it is not installed. +fn winget() -> Option { + let path = std::path::Path::new(&std::env::var_os("LOCALAPPDATA")?) + .join("Microsoft") + .join("WindowsApps") + .join("winget.exe"); + path.exists().then(|| tool(&path.to_string_lossy())) +} + /// A [`Command`] for an FFmpeg tool that does not open a console window on Windows. pub fn tool(program: &str) -> Command { let mut command = Command::new(program); @@ -204,7 +227,7 @@ pub fn refresh_path() -> bool { "[Environment]::GetEnvironmentVariable('Path', 'Machine') + ';' + ", "[Environment]::GetEnvironmentVariable('Path', 'User')" ); - let Ok(output) = tool("powershell.exe") + let Ok(output) = powershell() .args(["-NoProfile", "-NonInteractive", "-Command", script]) .stdin(std::process::Stdio::null()) .stderr(std::process::Stdio::null()) @@ -227,14 +250,15 @@ pub const WINGET_PACKAGE: &str = "Gyan.FFmpeg"; /// `true` when Windows' package manager, winget, runs here. pub fn winget_available() -> bool { - cfg!(windows) - && tool("winget") + winget().is_some_and(|mut winget| { + winget .arg("--version") .stdin(std::process::Stdio::null()) .stdout(std::process::Stdio::null()) .stderr(std::process::Stdio::null()) .status() .is_ok_and(|s| s.success()) + }) } /// Installs FFmpeg with winget, for the current user, accepting the package's agreements (the user asked @@ -242,7 +266,8 @@ pub fn winget_available() -> bool { /// winget's last lines. pub fn install_with_winget() -> anyhow::Result<()> { use anyhow::Context; - let output = tool("winget") + let output = winget() + .with_context(|| crate::tr!("media-winget-start-failed"))? .args(["install", "--id", WINGET_PACKAGE, "--exact", "--silent"]) .args(["--accept-package-agreements", "--accept-source-agreements"]) .arg("--disable-interactivity") diff --git a/src/sendto.rs b/src/sendto.rs index 18df122..07802bf 100644 --- a/src/sendto.rs +++ b/src/sendto.rs @@ -50,7 +50,7 @@ pub fn install() -> Result { $link.WorkingDirectory = $env:QVT_FOLDER; \ $link.Description = $env:QVT_DESCRIPTION; \ $link.Save()"; - let output = crate::ffmpeg::tool("powershell.exe") + let output = crate::ffmpeg::powershell() .args(["-NoProfile", "-NonInteractive", "-Command", script]) .env("QVT_LINK", &link) .env("QVT_TARGET", &exe) diff --git a/src/update/feed.rs b/src/update/feed.rs index 98fdac6..622930a 100644 --- a/src/update/feed.rs +++ b/src/update/feed.rs @@ -90,11 +90,25 @@ impl GitHub { .map_err(|error| Fault::NoConnection(error.to_string()))?; let status = response.status().as_u16(); if status == 200 { - Ok(response) - } else { - log::warn!("update: {url} answered {status}"); - Err(Fault::Status(status)) + return Ok(response); } + log::warn!("update: {url} answered {status}"); + let header = |name: &str| { + response + .headers() + .get(name) + .and_then(|v| v.to_str().ok()) + .and_then(|v| v.trim().parse::().ok()) + }; + if matches!(status, 403 | 429) && header("x-ratelimit-remaining") == Some(0) { + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .map_or(0, |d| d.as_secs()); + let minutes = + header("x-ratelimit-reset").map(|reset| reset.saturating_sub(now).div_ceil(60)); + return Err(Fault::RateLimited(minutes)); + } + Err(Fault::Status(status)) } } @@ -257,12 +271,13 @@ mod tests { )); } - /// A one-shot HTTP server on 127.0.0.1 answering each request with the next canned response. - fn serve(responses: Vec<(u16, String)>) -> String { + /// A one-shot HTTP server on 127.0.0.1 answering each request with the next canned response + /// (status, extra headers, body). + fn serve_with(responses: Vec<(u16, &'static str, String)>) -> String { let listener = TcpListener::bind("127.0.0.1:0").unwrap(); let address = listener.local_addr().unwrap(); std::thread::spawn(move || { - for (status, body) in responses { + for (status, headers, body) in responses { let Ok((mut stream, _)) = listener.accept() else { return; }; @@ -273,7 +288,7 @@ mod tests { } let _ = write!( stream, - "HTTP/1.1 {status} X\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{body}", + "HTTP/1.1 {status} X\r\n{headers}Content-Length: {}\r\nConnection: close\r\n\r\n{body}", body.len() ); } @@ -281,6 +296,25 @@ mod tests { format!("http://{address}") } + fn serve(responses: Vec<(u16, String)>) -> String { + serve_with(responses.into_iter().map(|(s, b)| (s, "", b)).collect()) + } + + #[test] + fn says_when_the_hourly_limit_is_reached() { + let base = serve_with(vec![ + ( + 403, + "x-ratelimit-remaining: 0\r\nx-ratelimit-reset: 1\r\n", + "{}".to_owned(), + ), + (403, "x-ratelimit-remaining: 12\r\n", "{}".to_owned()), + ]); + let feed = GitHub::with_api(&base, "o/r"); + assert_eq!(feed.latest(), Err(Fault::RateLimited(Some(0)))); + assert_eq!(feed.latest(), Err(Fault::Status(403))); + } + #[test] fn talks_http_and_reports_statuses() { let base = serve(vec![ diff --git a/src/update/install.rs b/src/update/install.rs index 34c315e..2e33b97 100644 --- a/src/update/install.rs +++ b/src/update/install.rs @@ -158,6 +158,16 @@ fn quoted(path: &Path) -> String { } /// The script run after this process (`pid`) exits. +/// +/// Frozen into each release: the script a version carries is the one that installs the next, so every +/// failure path ends with an executable in place and running (reviewed by GameModeExecutor's session, +/// 2026-11-24): +/// - the wait checks the process is still this program, by name (a process id can be reused); +/// - the swap renames `exe` → `.old`, then `.new` → `exe` (retried for 30 s: OneDrive may hold a file it is +/// uploading), then starts it; +/// - on failure, each recovery step has its own `try`, restore first: the new file set aside (back to +/// `.new`) if the old one was moved, the old one put back, then the restart, and `result.txt` written +/// last, so a failure to write it never skips the restore. pub fn swap_script(pid: u32, paths: &Paths) -> String { let (exe, new, old, result) = ( quoted(&paths.exe), @@ -165,27 +175,49 @@ pub fn swap_script(pid: u32, paths: &Paths) -> String { quoted(&paths.old), quoted(&paths.result), ); + let name = quoted(Path::new(paths.exe.file_stem().unwrap_or_default())); format!( "$ErrorActionPreference = 'Stop' -Wait-Process -Id {pid} -Timeout 30 -ErrorAction SilentlyContinue -function Retry([scriptblock] $Step) {{ +$exe = {exe} +$new = {new} +$old = {old} +$result = {result} +function Retry([scriptblock] $Step, [int] $Times) {{ for ($i = 1; ; $i++) {{ - try {{ & $Step; return }} catch {{ if ($i -ge 10) {{ throw }}; Start-Sleep -Milliseconds 500 }} + try {{ & $Step; return }} catch {{ if ($i -ge $Times) {{ throw }}; Start-Sleep -Milliseconds 500 }} }} }} +function Still-Running {{ + $process = Get-Process -Id {pid} -ErrorAction SilentlyContinue + $process -and $process.ProcessName -eq {name} +}} +if (Still-Running) {{ Wait-Process -Id {pid} -Timeout 30 -ErrorAction SilentlyContinue }} +if (Still-Running) {{ + try {{ Set-Content -LiteralPath $result -Value 'the application did not close' -Encoding UTF8 }} catch {{}} + exit 1 +}} +$moved = $false +$reason = $null try {{ - if (Get-Process -Id {pid} -ErrorAction SilentlyContinue) {{ throw 'the application did not close' }} - if (Test-Path -LiteralPath {old}) {{ Retry {{ Remove-Item -LiteralPath {old} -Force }} }} - Retry {{ Move-Item -LiteralPath {exe} -Destination {old} -Force }} - Retry {{ Move-Item -LiteralPath {new} -Destination {exe} }} - Start-Process -FilePath {exe} + if (Test-Path -LiteralPath $old) {{ Retry {{ Remove-Item -LiteralPath $old -Force }} 10 }} + Retry {{ Move-Item -LiteralPath $exe -Destination $old -Force }} 10 + $moved = $true + Retry {{ Move-Item -LiteralPath $new -Destination $exe }} 60 + Start-Process -FilePath $exe + exit 0 }} catch {{ - Set-Content -LiteralPath {result} -Value $_.Exception.Message -Encoding UTF8 - if (-not (Test-Path -LiteralPath {exe}) -and (Test-Path -LiteralPath {old})) {{ - Move-Item -LiteralPath {old} -Destination {exe} -Force - }} - if (-not (Get-Process -Id {pid} -ErrorAction SilentlyContinue)) {{ Start-Process -FilePath {exe} }} + $reason = $_.Exception.Message }} +if ($moved) {{ + try {{ + if (Test-Path -LiteralPath $exe) {{ Retry {{ Move-Item -LiteralPath $exe -Destination $new -Force }} 10 }} + }} catch {{ $reason += ' | setting the new file aside: ' + $_.Exception.Message }} + try {{ + Retry {{ Move-Item -LiteralPath $old -Destination $exe -Force }} 20 + }} catch {{ $reason += ' | restoring the previous version: ' + $_.Exception.Message }} +}} +try {{ Start-Process -FilePath $exe }} catch {{ $reason += ' | restarting: ' + $_.Exception.Message }} +try {{ Set-Content -LiteralPath $result -Value $reason -Encoding UTF8 }} catch {{}} " ) } @@ -202,7 +234,7 @@ pub fn launch(release: &Release, paths: &Paths) -> Result<(), Fault> { "update: installing {}; the application closes and comes back on it", release.version ); - crate::ffmpeg::tool("powershell.exe") + crate::ffmpeg::powershell() .args([ "-NoProfile", "-NonInteractive", @@ -393,14 +425,41 @@ mod tests { ); let script = swap_script(4242, &paths); assert!(script.contains("Wait-Process -Id 4242 -Timeout 30")); - assert!(script.contains(r"-LiteralPath 'C:\It''s [a] folder\quick-video-transcoder.exe'")); - assert!(!script.contains("\""), "no double quote reaches PowerShell"); - let rename = script - .find("-Destination 'C:\\It''s [a] folder\\quick-video-transcoder.exe.old'") + assert!(script.contains(r"$exe = 'C:\It''s [a] folder\quick-video-transcoder.exe'")); + assert!(script.contains("ProcessName -eq 'quick-video-transcoder'")); + assert!(!script.contains('"'), "no double quote reaches PowerShell"); + let at = |needle: &str| script.find(needle).unwrap_or_else(|| panic!("{needle}")); + // The swap: old aside, new in place (30 s of retries), then started. + assert!(at("-Destination $old -Force } 10") < at("-Destination $exe } 60")); + assert!(at("-Destination $exe } 60") < at("exit 0")); + // The recovery: the new file aside, the old one back, the restart, the report last. + let aside = at("-Destination $new -Force } 10"); + let restore = at("Move-Item -LiteralPath $old -Destination $exe -Force } 20"); + let restart = script.rfind("Start-Process -FilePath $exe").unwrap(); + let report = script.rfind("Set-Content -LiteralPath $result").unwrap(); + assert!(aside < restore && restore < restart && restart < report); + } + + /// Windows PowerShell's own parser accepts the script (it is never run here). + #[cfg(windows)] + #[test] + fn the_script_parses_in_windows_powershell() { + let paths = Paths::new( + Path::new(r"C:\It's [a] folder\quick-video-transcoder.exe"), + Path::new(r"C:\Data"), + ); + let output = crate::ffmpeg::powershell() + .args(["-NoProfile", "-NonInteractive", "-Command"]) + .arg("[void][ScriptBlock]::Create($env:QVT_SCRIPT); 'parsed'") + .env("QVT_SCRIPT", swap_script(4242, &paths)) + .output() .unwrap(); - let start = script.find("Start-Process").unwrap(); - assert!(rename < start, "the swap happens before the restart"); - assert!(script.contains("catch")); + let stdout = String::from_utf8_lossy(&output.stdout); + assert!( + output.status.success() && stdout.contains("parsed"), + "{stdout}{}", + String::from_utf8_lossy(&output.stderr) + ); } #[test] diff --git a/src/update/mod.rs b/src/update/mod.rs index 9c1d5a9..d8ccf52 100644 --- a/src/update/mod.rs +++ b/src/update/mod.rs @@ -83,6 +83,9 @@ pub enum Fault { NoConnection(String), /// GitHub answered with this HTTP status. Status(u16), + /// GitHub's limit of 60 unauthenticated requests an hour per IP address is reached (shared by + /// everyone behind the same address); minutes until it resets, when GitHub says. + RateLimited(Option), /// An answer this version does not understand (no such asset, a tag not `vX.Y.Z`, not JSON…). Unexpected(String), /// The downloaded file's SHA-256 is not the published one.