fix: doPrestige return type mismatch — interface says void but returns boolean #48

Closed
opened 2026-05-18 16:02:33 +02:00 by Anexim · 3 comments
Owner

Severity: Major

File: src/lib/game/stores/prestigeStore.ts (lines 94-103)

Problem: doPrestige returns false on failure and true/undefined on success, but the PrestigeState interface declares it as () => void. This is a type mismatch — TypeScript won't catch callers trying to use the return value, and the interface lies about the contract.

Impact: Type safety issue. Callers who check the return value get no type support. The interface is misleading.

Fix: Update the PrestigeState interface to declare doPrestige: (id: string) => boolean.

**Severity:** Major **File:** `src/lib/game/stores/prestigeStore.ts` (lines 94-103) **Problem:** `doPrestige` returns `false` on failure and `true`/`undefined` on success, but the `PrestigeState` interface declares it as `() => void`. This is a type mismatch — TypeScript won't catch callers trying to use the return value, and the interface lies about the contract. **Impact:** Type safety issue. Callers who check the return value get no type support. The interface is misleading. **Fix:** Update the `PrestigeState` interface to declare `doPrestige: (id: string) => boolean`.
Anexim added the ai:todo label 2026-05-18 16:02:33 +02:00
n8n-gitea was assigned by Anexim 2026-05-18 16:02:33 +02:00
Author
Owner

[priority: 4] BROKEN FEATURE — doPrestige return type mismatch (interface says void, returns boolean).

[priority: 4] BROKEN FEATURE — doPrestige return type mismatch (interface says void, returns boolean).
Author
Owner

Starting work on #48. Reading prestigeStore.ts to fix the doPrestige return type mismatch.

Starting work on #48. Reading prestigeStore.ts to fix the doPrestige return type mismatch.
Author
Owner

Fixed. Changed the PrestigeState interface declaration from doPrestige: (id: string) => void to doPrestige: (id: string) => boolean to match the actual implementation which returns false on failure and true on success.

Fixed. Changed the PrestigeState interface declaration from `doPrestige: (id: string) => void` to `doPrestige: (id: string) => boolean` to match the actual implementation which returns false on failure and true on success.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#48