Best score is stored in two places that can disagree

Aperta
#41 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
74/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Start with shared/storage.ts and trace how getHighScore reads saved values; then compare that with shared/achievements.ts and the submitHighScore calls in shared/scenes.ts. Preserve existing best scores while making one value authoritative, and verify with npm run typecheck and npm run build.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

severity: low tech-debt

Summary

The game-over scene writes the best score twice: under <slug>:highscore and as games[slug].best inside the trophies save. Hub cards and menus read the first; the Trophies panel reads the second; resetting trophies clears only the second.

Where

  • shared/storage.ts:21-30
  • shared/achievements.ts:135-141, shared/achievements.ts:164-167
  • shared/scenes.ts:92-93, src/hub/main.ts:58

Steps to reproduce

  1. Play a game, then reset trophies on the hub.
  2. The card still shows the old best while the Trophies panel shows none.

Suggested fix

Make getHighScore read the stats value with a one-time fallback to the legacy key, have recordPlay return whether the score is a record, then remove submitHighScore.

Acceptance criteria

  • One stored best score per game; existing bests survive the change

Getting started

  • Relevant files: shared/storage.ts, shared/achievements.ts, shared/scenes.ts
  • Run locally: npm install, then npm run dev
  • Checks: npm run typecheck and npm run build (there is no test suite yet)
  • Related docs: README.md

Filed by repo-audit/full-audit at b001f5d. Severity: low. Effort: S. audit-key: tech-debt|shared/storage.ts|submitHighScore

Lingua principale
TypeScript
Stelle
3
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TMHSDigital/GH-Arcade

Tutte le issue di TMHSDigital/GH-Arcade

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.