Repository navigation
Conversation
…doesn't drop the world Fixes #5395. ReadWriteStorageManager rebuilds the manifest's world list purely from UniverseConfig on every save - but only "Create New Game" (GameManifestProvider) and headless setup (StateHeadlessSetup) ever populated it. Every other load path (SelectGameScreen's "Load Game", CLI --load-last-game/--create-last-game, multiplayer join) went straight to StateLoading without ever calling addWorldManager, so the first save after loading an existing game silently dropped that world - including its worldGenerator - from manifest.json, making it unloadable afterwards. Moved the population into InitialiseWorld.step(), the one load process every entry point (new game or existing) already runs through with both the manifest and the Config in hand. Idempotent for the two paths that already did this themselves. No automated regression test: the only existing harness exercising this load process (MTE's TestingStateHeadlessSetup) is itself modeled on the one path that was never buggy, so it can't reproduce the missing-population precondition without disproportionate new test-infrastructure work. Verified by tracing every StateLoading entry point and confirming (via a temporary diagnostic assertion, since removed) that UniverseConfig is empty at save time without this fix and populated with it, on both the CLI/GUI-review-of-code path and the MTE-bootstrapped integration tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughWorld initialization now adds the current ChangesWorld initialization
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is established. Preservation of externally populated additional worlds remains uncertain, but normal existing-game loading has not been shown to use them. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change addresses a world-loss-on-save path, but it also allows joined-server world metadata to remain in the client’s local configuration after the session. The observed exposure is limited to gameplay metadata; no credential exposure or unauthorized game save was established. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the world’s new seed, Comment |
Summary
worldGenerator- and the rest of itsWorldInfo- frommanifest.json, making the world unloadable afterwards.ReadWriteStorageManager.addGameManifestToSaveTransaction()rebuilds the manifest's world list purely fromConfig.getUniverseConfig()on every save. Only "Create New Game" (GameManifestProvider) and headless setup (StateHeadlessSetup) ever populatedUniverseConfig. Every other way to start playing an existing save -SelectGameScreen's "Load Game" button, CLI--load-last-game/--create-last-game, multiplayer join - went straight toStateLoadingwithout ever callingUniverseConfig.addWorldManager().InitialiseWorld.step(), the one load process every entry point (new or existing game) already runs through with both theGameManifestandConfigin hand. Idempotent for the two paths that already did this themselves.worldGenerator/UniverseConfig/InitialiseWorld- none touch this.Test plan
engine:compileJava,engine:checkstyleMain- clean.engine-tests:integrationTest --tests StorageManagerTest- all 11 existing tests still pass (no regression from the extra, idempotentUniverseConfigpopulation).TestingStateHeadlessSetup) is itself modeled onStateHeadlessSetup, the one path that was never buggy, so it can't reproduce the missing-population precondition without new test infrastructure. Verified instead by tracing everyStateLoadingentry point, and empirically by temporarily reverting the fix and diagnostically printingUniverseConfigstate under MTE (confirmed populated either way there, for the reason above - meaning the bug is real but only reachable through the GUI/CLI load paths, not the existing integration-test harness).Related