From ee47c1e8c913a23057a6f4c9ef0717a1c3e85872 Mon Sep 17 00:00:00 2001 From: Hikari Date: Fri, 20 Mar 2026 09:30:57 -0700 Subject: [PATCH] fix: auto-boss no longer halts on client/server save race condition (#91) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Fixes #86. When the client state is ahead of the server save, the auto-boss tick would receive a "Boss is not currently available" error from the API. This error was already acknowledged as an expected race condition and suppressed from telemetry — but it was still setting the error state and turning auto-boss off. ## Root Cause The `catch` handler treated all errors identically: set `autoBossError`, turn off `autoBoss`. The race-condition case should instead silently skip so the next tick can retry naturally. ## Fix When the error is `"Boss is not currently available"`, return early from the `catch` handler. The `finally` block still runs, resetting `isAutoBossingReference.current = false`, so the next tick retries cleanly. ✨ This PR was created with help from Hikari~ 🌸 Reviewed-on: https://git.nhcarrigan.com/nhcarrigan/elysium/pulls/91 Co-authored-by: Hikari Co-committed-by: Hikari --- apps/web/src/context/gameContext.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/web/src/context/gameContext.tsx b/apps/web/src/context/gameContext.tsx index e3275b7..aa51ce7 100644 --- a/apps/web/src/context/gameContext.tsx +++ b/apps/web/src/context/gameContext.tsx @@ -1316,11 +1316,13 @@ export const GameProvider = ({ /* * "Boss is not currently available" is an expected race condition - * in the tick loop — suppress telemetry for this case only + * when the client is ahead of the server save — silently skip and + * let the next tick retry rather than halting automation. */ - if (message !== "Boss is not currently available") { - logError("auto_boss", error_); + if (message === "Boss is not currently available") { + return; } + logError("auto_boss", error_); setAutoBossError(message); setState((previous) => { if (previous === null) {