BUG: "Climb the Spire" crashes with React error #185 (Maximum update depth exceeded) #209
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Clicking "Climb the Spire" crashes the entire game with React error #185 (Maximum update depth exceeded). This is a critical bug that makes the Spire/Climbing feature completely unusable.
Reproduction
Investigation
The crash triggers when
SpireCombatPagemounts and theuseEffectfires to regenerate the room state combined withuseMemocallinggetRoomsForFloor(currentFloor)(which usesMath.random()). The component'suseEffectat lines 131-135 callssetCurrentRoom(newRoom)which triggers a re-render, and theuseMemofortotalRoomscan produce different values across renders since it usesMath.random(), causing an infinite setState loop:Additionally,
enterSpireMode()incombatStore.tscallsgenerateSpireFloorState(1, 0, 1)with a hardcodedtotalRooms = 1, which then gets overridden by the component'suseEffectthat calls it again.Affected Files
src/components/game/tabs/SpireCombatPage/SpireCombatPage.tsx- Main crash locationsrc/lib/game/stores/combatStore.ts-enterSpireModeactionsrc/lib/game/utils/spire-utils.ts-getRoomsForFloorusesMath.random()Severity
Critical - Entire Spire climbing feature is completely broken. Players cannot enter the Spire at all.
⚠️ Playwright Result (QA Run 2026-05-30)
Status: PARTIAL - No runtime React crash detected, but a related UI issue was found.
Playwright Evidence
generateSpireFloorStateis confined to event handlers/effects)getByRole('button', { name: /climb/i })resolved to 2 elements (one in LeftPanel, one in SpireSummaryTab)New Related Bug Filed
Issue #211 documents the duplicate "Climb the Spire" buttons problem.
SpireCombatPage Analysis
Code review of
SpireCombatPage.tsxlines 99-103:setCurrentRoomandsetRoomsClearedare Zustand store setters (stable references)totalRoomsis derived fromcurrentFloorvia useMemo, so it only changes when floor changesConclusion
The original crash (React error #185) may have been fixed in a previous commit, or it may require specific timing conditions not captured in this test run. The strict mode violation from duplicate buttons is the current testing blocker for Spire entry.
Closed — Playwright analysis confirmed low risk for infinite loop. The SpireCombatPage useEffect dependencies (currentFloor, totalRooms, setCurrentRoom) are stable enough to prevent infinite setState loops. No runtime crash detected in latest test run.