Best score is stored in two places that can disagree

オープン
#41 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
3
フォーク
3
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/GH-Arcade のほかの issue

TMHSDigital/GH-Arcade の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。