Past games with the same moves merge, losing the newer game's date and opponent
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 84/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript
Rechercherichtung
Beginne mit addToArchive in js/game-store.js und dem Ablauf zum Laden des Archivs in js/game-ui.js (handleArchiveClick); js/notation.js definiert den Vergleich des Zugtexts. Lies tests/unit/archive.test.js und führe npm test aus, um das bestehende Archivverhalten zu prüfen. Das Ziel ist erreicht, wenn separate Partien mit identischen Zügen getrennt bleiben und das erneute Öffnen und Archivieren einer Partie ihren eigenen Eintrag ersetzt, auch nachdem sie beendet wurde.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
addToArchive treats two past games as the same game when their FEN and their movetext match. The merge is meant for a game that was opened from the list and put back. But separate games with identical moves also merge, and the newer game's date and opponent are lost.
Where
js/game-store.js:79-83(addToArchive)js/notation.js:203(pgnMovetext)
Details
const same = (entry) => pgnMovetext(entry.pgn) === pgnMovetext(game.pgn);
const entry = archive.find(same) || game; // the older entry wins
The comparison ignores the player names, the date and the time control.
Impact
- Short games merge: every game abandoned after
1. e4, a quick resignation, or the same short line against different levels. The list shows one entry, with the first game's date and opponent. - In the other direction, a game archived while unfinished (
*) and later reopened and finished stays in the list twice, because the movetext differs.
Steps to reproduce
- Start a game, play 1.e4, then press New Game twice to discard it.
- Change the opponent level and repeat.
- Open Load. There is one "1 move" entry, with the first game's opponent and date.
Suggested fix
Remember which archive entry a game was opened from, for example by keeping that entry's date in gameStart when handleArchiveClick loads it. Merge only with that entry, and replace it, so a finished version replaces its unfinished copy. As a simpler alternative, add the White/Black tags and the date to the comparison key.
Acceptance criteria
- Two separate games with the same moves are kept as two entries
- A game opened from the list and put back replaces its own entry (also when it was finished meanwhile)
Getting started
- Relevant files:
js/game-store.js,js/game-ui.js(handleArchiveClick),tests/unit/archive.test.js - How to run tests:
npm ci && npm test
Filed by repo-audit/full-audit at 73cd279. Severity: low. Effort: S. audit-key: bug|js/game-store.js|addToArchive
- Vorherrschende Sprache
- JavaScript
- Sterne
- 4
- Forks
- 2
- Ø Merge
- 6 Std. 13 Min.
- Gemergte PRs (30 T.)
- 4
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TMHSDigital/Static_Chess
-
enhancement good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
TMHSDigital/Static_Chess#163 ·
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue performance severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
TMHSDigital/Static_Chess#157 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation good first issue severity: low
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 90/100
TMHSDigital/Static_Chess#155 ·
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue reliability severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
TMHSDigital/Static_Chess#150 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
TMHSDigital/Static_Chess#145 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in TMHSDigital/Static_Chess
Ähnliche Issues
-
marketing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
[Bug] Account menu (footer ⚙) doesn't dismiss on outside click — stays open and covers the Bot listOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Fei2411/DeepSeek-Bot#1693 ·
-
area-templates triage:bot-seen triage:needs-human
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
microsoft/aspire#22356 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
HarperFast/skills#153 ·