From a36443bd868514fce0af3563508aeea4f688faff Mon Sep 17 00:00:00 2001 From: en Date: Wed, 16 Sep 2026 08:03:48 +0200 Subject: [PATCH] refresh_slots: always call sync_slot_overlays, even on early-return paths (Bug #10) Bug from Grok round-1 #10. Two branches in refresh_slots (the routing-on and routing-off arms) returned early after finish_vfx, so sync_slot_overlays at the bottom of the function was skipped. That meant the slot-number overlay hub could lag by up to a full tick when the user switched focus into or out of the team. Both early-return branches now bind the finish_vfx result, call sync_slot_overlays, and return the bound result. cargo test 96+/0; clippy clean. --- src/session.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/session.rs b/src/session.rs index b57a67a..5ec247b 100644 --- a/src/session.rs +++ b/src/session.rs @@ -223,7 +223,11 @@ async fn refresh_slots( let mut g = session.lock().await; g.binds_on = true; tracing::info!("routing on ({} binds)", specs.len()); - return finish_vfx(g, vfx_tx, hub, cursor).await; + let r = finish_vfx(g, vfx_tx, hub, cursor).await; + // Bug #10: don't drop sync_slot_overlays on early-return + // paths. The non-early path below already calls it. + sync_slot_overlays(session, slot_hub).await; + return r; } } else if g.binds_on { g.binds_on = false; @@ -232,7 +236,10 @@ async fn refresh_slots( hypr::clear_binds().await.ok(); tracing::info!("routing off (focus left the team)"); let g = session.lock().await; - return finish_vfx(g, vfx_tx, hub, cursor).await; + let r = finish_vfx(g, vfx_tx, hub, cursor).await; + // Bug #10: keep this in sync with the early-return above. + sync_slot_overlays(session, slot_hub).await; + return r; } }