fix: replace silent error swallowing with proper error propagation

Replace .filter_map(Result::ok).collect() with .collect::<Result<Vec<_>,_>>()?
in rename chain resolution and suffix probe queries. The old pattern silently
discarded database errors, making failures invisible. Now any rusqlite error
propagates to the caller immediately.

Affected: resolve_rename_chain (2 queries) and resolve_ambiguity (1 query).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
teernisse
2026-02-18 13:28:30 -05:00
parent c953d8e519
commit c0ca501662
2 changed files with 3 additions and 6 deletions

View File

@@ -294,8 +294,7 @@ fn try_resolve_rename_ambiguity(
let old_paths: Vec<String> = stmt
.query_map(param_refs.as_slice(), |row| row.get(0))?
.filter_map(std::result::Result::ok)
.collect();
.collect::<std::result::Result<Vec<_>, _>>()?;
// The newest path is a candidate that is NOT an old_path in any intra-chain rename.
let newest = candidates.iter().find(|c| !old_paths.contains(c));