fix: auto-boss no longer halts on client/server save race condition (#91)
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m4s
CI / Lint, Build & Test (push) Successful in 1m10s

## 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: #91
Co-authored-by: Hikari <hikari@nhcarrigan.com>
Co-committed-by: Hikari <hikari@nhcarrigan.com>
This commit was merged in pull request #91.
This commit is contained in:
2026-03-20 09:30:57 -07:00
committed by Naomi Carrigan
parent 2236d1dc9f
commit ee47c1e8c9
+5 -3
View File
@@ -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) {