Skip to content

fix for old replays#89

Open
alfaoz wants to merge 2 commits intoWolverinDEV:masterfrom
alfaoz:fix/old-replays
Open

fix for old replays#89
alfaoz wants to merge 2 commits intoWolverinDEV:masterfrom
alfaoz:fix/old-replays

Conversation

@alfaoz
Copy link
Copy Markdown
Contributor

@alfaoz alfaoz commented Apr 26, 2026

Summary

  • Restore loading of legacy tournament replays whose persisted records predate four newer SessionTournamentInfo fields
  • Add defaults in the shared Zod schema (pendingExtensionfalse, matchJoinTimeoutInMsnull, leftProfileId / rightProfileIdnull) so old records parse cleanly through both zDatabaseGame and zFinishedGameRecord
  • Add a regression test covering a legacy tournament game record without those fields

Copilot AI review requested due to automatic review settings April 26, 2026 08:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores backward-compatible parsing of legacy tournament replay records by defaulting newer SessionTournamentInfo fields so older persisted data can still be loaded through shared Zod schemas.

Changes:

  • Added Zod defaults for newer SessionTournamentInfo fields (pendingExtension, matchJoinTimeoutInMs, leftProfileId, rightProfileId) to support legacy records.
  • Added a backend regression test that parses a legacy tournament game record missing those fields and asserts defaulted values.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/shared/src/tournaments.ts Adds Zod defaults to tolerate missing newer tournament session fields in old persisted records.
packages/backend/src/persistence/gameHistoryRepository.test.ts Introduces a regression test ensuring legacy tournament replay records parse and receive expected defaults.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/backend/src/persistence/gameHistoryRepository.test.ts Outdated
Comment thread packages/shared/src/tournaments.ts
Comment thread packages/backend/src/persistence/gameHistoryRepository.test.ts Outdated
- Rename regression test to cover all defaulted legacy fields
- Constrain matchJoinTimeoutInMs to non-negative durations
- Drop void prefix on test() to match repo style
@alfaoz
Copy link
Copy Markdown
Contributor Author

alfaoz commented Apr 26, 2026

willfixhopefully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants