From a6c7e5fab543c2736b07b6914b5ebe013ed26319 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 11 May 2026 21:50:26 +0000 Subject: [PATCH] Use if-let shape for refresh outcome handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switch from match-on-Result to if-let-Err so the refresh outcome and merge_result outcome are checked independently, making the intent clearer: 'attempt refresh; on Ok-merge-with-refresh-error propagate; on Err-merge-with-refresh-error log and surface the original merge error'. No semantic change — both shapes were valid (wildcard patterns don't move the scrutinee) — but the if-let form sidesteps a needs-second-reading question raised in code review. Co-Authored-By: Ragnor Comerford --- crates/omnigraph/src/exec/merge.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/crates/omnigraph/src/exec/merge.rs b/crates/omnigraph/src/exec/merge.rs index fdcd68c..f214fa1 100644 --- a/crates/omnigraph/src/exec/merge.rs +++ b/crates/omnigraph/src/exec/merge.rs @@ -1144,17 +1144,15 @@ impl Omnigraph { // that with a less informative error; the next op or the next // `Omnigraph::open` will re-sync the coord anyway. if previous_branch == target_branch { - match merge_result { - Ok(_) => self.refresh_coordinator_only().await?, - Err(_) => { - if let Err(err) = self.refresh_coordinator_only().await { - tracing::warn!( - error = %err, - "post-merge coordinator refresh failed on the error path; \ - the next op or open will re-sync" - ); - } + if let Err(refresh_err) = self.refresh_coordinator_only().await { + if merge_result.is_ok() { + return Err(refresh_err); } + tracing::warn!( + error = %refresh_err, + "post-merge coordinator refresh failed on the error path; \ + the next op or open will re-sync" + ); } }