Skip to content

Remove planets that are not in the game only on save - #5965

Merged
wholton merged 1 commit into
masterfrom
fix-planet-repair-on-save
Oct 22, 2026
Merged

wholton merged 1 commit into
masterfrom
fix-planet-repair-on-save

Conversation

@wholton

@wholton wholton commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

The repair that removes planets a player holds but the game doesn't have (moved out of the planet card in #5955) ran in TransientGameInfoUpdater.update, which runs on every load as well as every save. That meant:

  • Every load logged "Planet X not found in game Y. Removed planet from player." The removal itself was kept only if the game was later saved.
  • Queued renders draw from an in-memory save and load copy, so each render logged it again and threw the change away.
  • Ended or abandoned games, which nobody saves, logged the same removals on every load, for example whenever a job read every game.

Now:

  • The repair runs only on save (GameSaveService.updateBeforeSave), where the removal is written. It's logged once, when it actually happens.
  • Loading leaves the planets alone.
  • The player area skips a missing planet's card without logging, because the save-time repair already reports it.

Tests

  • TransientGameInfoUpdaterTest covers the repair on its own. A new test checks that loading a game keeps a planet that isn't in the game.
  • mvn -o test: 1,781 tests, 0 failures.

🤖 Generated with Claude Code

The repair ran on every load too, including the copy each queued render takes, so an ended game that nobody saves logged the same removals on every load without ever keeping them. It now runs only on save, where the removal is written and logged once. A player area skips a missing planet's card without logging.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔬 Test Results

✅ JSON Validation

No JSON files changed.


✅ Formatting Checks Passed

All files pass Spotless formatting.


✅ JUnit Tests Passed

All tests passed successfully.

@wholton
wholton merged commit 2ef2894 into master Oct 22, 2026
3 checks passed
@wholton
wholton deleted the fix-planet-repair-on-save branch October 22, 2026 16:58
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.

1 participant