Fix second audit findings and restore crash detection dialog

Address 29 issues found in comprehensive API/spec audit:
- Fix .desktop Exec key path escaping per Desktop Entry spec
- Fix update dialog double-dispatch with connect_response
- Fix version comparison total ordering with lexicographic fallback
- Use RETURNING id for reliable upsert in database
- Replace tilde-based path fallbacks with proper XDG helpers
- Fix backup create/restore path asymmetry for non-home paths
- HTML-escape severity class in security reports
- Use AppStream <custom> element instead of <metadata>
- Fix has_appimage_update_tool to check .is_ok() not .success()
- Use ListBoxRow instead of ActionRow::set_child in ExpanderRow
- Add ELF magic validation to architecture detection
- Add timeout to extract_update_info_runtime
- Skip symlinks in dir_size calculation
- Use Condvar instead of busy-wait in analysis thread pool
- Restore crash detection to single blocking call architecture
This commit is contained in:
lashman
2026-02-27 22:48:43 +02:00
parent e9343da249
commit 830c3cad9d
21 changed files with 228 additions and 181 deletions

View File

@@ -609,48 +609,36 @@ fn cmd_launch(db: &Database, path: &str) -> ExitCode {
// Try to find in database for tracking
let record = db.get_appimage_by_path(path).ok().flatten();
if let Some(ref record) = record {
match launcher::launch_appimage(db, record.id, file_path, "cli", &[], &[]) {
launcher::LaunchResult::Started { method, .. } => {
println!(
"Launched {} ({})",
record.app_name.as_deref().unwrap_or(&record.filename),
method.as_str(),
);
ExitCode::SUCCESS
}
launcher::LaunchResult::Crashed { stderr, exit_code, .. } => {
eprintln!(
"App crashed immediately (exit code: {})\n{}",
exit_code.map(|c| c.to_string()).unwrap_or_else(|| "unknown".into()),
stderr,
);
ExitCode::FAILURE
}
launcher::LaunchResult::Failed(msg) => {
eprintln!("Error: {}", msg);
ExitCode::FAILURE
}
}
let launch_result = if let Some(ref record) = record {
launcher::launch_appimage(db, record.id, file_path, "cli", &[], &[])
} else {
// Not in database - launch without tracking
match launcher::launch_appimage_simple(file_path, &[]) {
launcher::LaunchResult::Started { method, .. } => {
println!("Launched {} ({})", path, method.as_str());
ExitCode::SUCCESS
}
launcher::LaunchResult::Crashed { stderr, exit_code, .. } => {
eprintln!(
"App crashed immediately (exit code: {})\n{}",
exit_code.map(|c| c.to_string()).unwrap_or_else(|| "unknown".into()),
stderr,
);
ExitCode::FAILURE
}
launcher::LaunchResult::Failed(msg) => {
eprintln!("Error: {}", msg);
ExitCode::FAILURE
}
launcher::launch_appimage_simple(file_path, &[])
};
match launch_result {
launcher::LaunchResult::Started { pid, method } => {
let name = record.as_ref()
.and_then(|r| r.app_name.as_deref())
.unwrap_or(path);
println!("Launched {} (PID: {}, {})", name, pid, method.as_str());
ExitCode::SUCCESS
}
launcher::LaunchResult::Crashed { exit_code, stderr, method } => {
let name = record.as_ref()
.and_then(|r| r.app_name.as_deref())
.unwrap_or(path);
eprintln!(
"{} crashed on launch (exit code: {}, method: {})\n{}",
name,
exit_code.map(|c: i32| c.to_string()).unwrap_or_else(|| "unknown".into()),
method.as_str(),
stderr,
);
ExitCode::FAILURE
}
launcher::LaunchResult::Failed(msg) => {
eprintln!("Error: {}", msg);
ExitCode::FAILURE
}
}
}