fix the failures that were failing quietly

This commit is contained in:
2026-09-21 06:22:44 +03:00
parent 371c910068
commit b33ce5bf77
8 changed files with 110 additions and 35 deletions
+26 -5
View File
@@ -1045,11 +1045,29 @@ const GIF_ESTIMATE_GRID: &[u64] = &[
104_857_600, 209_715_200,
];
/// The size-table scan sweeps target sizes itself, so it needs only the inputs
/// that shape a GIF budget - not the single requested target that
/// `PreviewRequest` requires.
#[derive(Debug, Deserialize)]
pub struct GifTableRequest {
pub fps: u32,
#[serde(default)]
pub gif_budget_mode: GifBudgetMode,
#[serde(default)]
pub gif_colors: Option<u16>,
#[serde(default)]
pub clip_width: u32,
#[serde(default)]
pub clip_height: u32,
#[serde(default)]
pub duration_secs: Option<f64>,
}
/// Return estimates for a grid of `target_bytes` values so the frontend can
/// interpolate on slider drag without an IPC per debounce tick. The grid is
/// geometric from 100KB to 200MB.
#[tauri::command]
fn estimate_gif_params_table(request: PreviewRequest) -> GifEstimateTable {
fn estimate_gif_params_table(request: GifTableRequest) -> GifEstimateTable {
let colors = request.gif_colors.unwrap_or(256);
let dur = request.duration_secs.unwrap_or(0.0).max(0.1);
let fps = request.fps;
@@ -2214,13 +2232,16 @@ pub fn run() {
Ok(Some(info)) => {
tracing::info!(version = info.version, "update available");
drop(handle.emit("update-available", &info));
updates::stamp_check(&app_dir);
}
Ok(None) => tracing::debug!("no update available"),
Ok(None) => {
tracing::debug!("no update available");
updates::stamp_check(&app_dir);
}
// No stamp on failure, so a transient network error does
// not silence the check for the whole TTL.
Err(e) => tracing::warn!("update check failed: {e:#}"),
}
// Stamp success on Ok results so a future launch won't
// re-check until the TTL elapses. Errors don't stamp.
updates::stamp_check(&app_dir);
});
}
Ok(())