Best score is stored in two places that can disagree

Abierto
#41 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
74/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
3
Forks
3
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TMHSDigital/GH-Arcade

Todos los issues de TMHSDigital/GH-Arcade

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.