[priority: 3] Combat store partialize missing floorHP/floorMaxHP/castProgress — state lost on refresh #80

Closed
opened 2026-05-19 09:11:18 +02:00 by Anexim · 2 comments
Owner

Severity: 3 — Medium
File: src/lib/game/stores/combatStore.ts

Description:
The partialize function only persists currentFloor, maxFloorReached, spells, and activeSpell. Critical combat state like floorHP, floorMaxHP, castProgress, spireMode, clearedFloors, golemancy, equipmentSpellStates, activityLog, and achievements are not persisted.

On page refresh, the combat store resets to its initial state (floor 1, full HP, no cast progress) even though currentFloor and spells are restored. This creates an inconsistency: you could be on floor 50 with spells learned, but floor HP is reset to floor 1 values.

Fix: Add floorHP, floorMaxHP, castProgress, and other critical combat state to partialize.

**Severity:** 3 — Medium **File:** `src/lib/game/stores/combatStore.ts` **Description:** The `partialize` function only persists `currentFloor`, `maxFloorReached`, `spells`, and `activeSpell`. Critical combat state like `floorHP`, `floorMaxHP`, `castProgress`, `spireMode`, `clearedFloors`, `golemancy`, `equipmentSpellStates`, `activityLog`, and `achievements` are **not persisted**. On page refresh, the combat store resets to its initial state (floor 1, full HP, no cast progress) even though `currentFloor` and `spells` are restored. This creates an inconsistency: you could be on floor 50 with spells learned, but floor HP is reset to floor 1 values. **Fix:** Add `floorHP`, `floorMaxHP`, `castProgress`, and other critical combat state to `partialize`.
Anexim added the ai:todo label 2026-05-19 09:11:18 +02:00
n8n-gitea was assigned by Anexim 2026-05-19 09:11:18 +02:00
Author
Owner

Starting work on combat store partialize fix.

Starting work on combat store partialize fix.
Author
Owner

Fixed. Added floorHP, floorMaxHP, castProgress, spireMode, clearedFloors, golemancy, equipmentSpellStates, activityLog, and achievements to the combat store's partialize function. Combat state now persists correctly across page refreshes. Regression tests added.

✅ Fixed. Added `floorHP`, `floorMaxHP`, `castProgress`, `spireMode`, `clearedFloors`, `golemancy`, `equipmentSpellStates`, `activityLog`, and `achievements` to the combat store's `partialize` function. Combat state now persists correctly across page refreshes. Regression tests added.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#80