{"record":{"id":"3aff21c95a76f2ae","repo":"jlcodes99/cockpit-tools","slug":"startupperf-updatercommand-update-last-check-ti","errorCode":null,"errorMessage":"[StartupPerf][UpdaterCommand] update_last_check_time failed in {}ms: {}","messagePattern":"\\[StartupPerf\\]\\[UpdaterCommand\\] update_last_check_time failed in (.+?)ms: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src-tauri/src/commands/update.rs","lineNumber":27,"sourceCode":"    // #1104: respect external-network kill switch for auto update probes.\n    if !crate::modules::config::get_user_config().external_network_enabled {\n        return Ok(false);\n    }\n    let settings = update_checker::load_update_settings()?;\n    Ok(update_checker::should_check_for_updates(&settings))\n}\n\n/// Update the last check time\n#[tauri::command]\npub fn update_last_check_time() -> Result<(), String> {\n    let started = Instant::now();\n    let result = update_checker::update_last_check_time();\n    match &result {\n        Ok(_) => logger::log_info(&format!(\n            \"[StartupPerf][UpdaterCommand] update_last_check_time completed in {}ms\",\n            started.elapsed().as_millis()\n        )),\n        Err(err) => logger::log_error(&format!(\n            \"[StartupPerf][UpdaterCommand] update_last_check_time failed in {}ms: {}\",\n            started.elapsed().as_millis(),\n            err\n        )),\n    }\n    result\n}\n\n/// Get update settings\n#[tauri::command]\npub fn get_update_settings() -> Result<UpdateSettings, String> {\n    let started = Instant::now();\n    let result = update_checker::load_update_settings();\n    match &result {\n        Ok(settings) => logger::log_info(&format!(\n            \"[StartupPerf][UpdaterCommand] get_update_settings completed in {}ms: auto_check={}, auto_install={}, last_check_time={}\",\n            started.elapsed().as_millis(),\n            settings.auto_check,","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/jlcodes99/cockpit-tools/blob/1ed8b77992d62ca81fabf744deb0839ad361d5bf/src-tauri/src/commands/update.rs#L9-L45","documentation":"The update_last_check_time command calls update_checker::update_last_check_time() and, on Err, logs '[StartupPerf][UpdaterCommand] update_last_check_time failed in {ms}ms: {err}' before returning the result. It means persisting the 'last update check' timestamp failed, usually a settings/config store write error.","triggerScenarios":"update_checker::update_last_check_time returns Err: the update settings file cannot be read or written (permissions, lock, corruption) or time serialization fails.","commonSituations":"Config directory read-only; concurrent startup tasks contending for the settings file; corrupted update-settings JSON from a prior crash.","solutions":["Inspect the inner err after the message for the underlying storage error.","Check write permissions on the update settings/config file location.","Validate/repair or reset the update settings file if it is corrupted JSON.","Retry the command after startup contention subsides (other startup writers finished)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const settingsOk = await invoke('validate_update_settings_file').catch(() => false);\nif (!settingsOk) await invoke('reset_update_settings');","typeGuard":null,"tryCatchPattern":"try {\n  await invoke('update_last_check_time');\n} catch (e) {\n  console.warn('last-check-time persist failed; updater will re-check next launch', e);\n  // non-fatal: fall back to default check cadence\n}","preventionTips":["Ensure the settings file location is writable at install time","Serialize settings writes across startup tasks","Validate settings JSON schema after app upgrades","Treat last-check-time failures as non-fatal and retry next launch"],"tags":["updater","storage","startup-perf","tauri"],"backgroundTag":"settings-write-failed","analyzedSha":"1ed8b77992d62ca81fabf744deb0839ad361d5bf","analyzedAt":"2026-09-05T09:51:41.178Z","contentChangedAt":"2026-09-05T09:51:41.178Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}