mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #7783] Checkpoint loads don't restore the State Editor's World Edits #4293
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#4293
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ylli-selmani on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7783
Originally assigned to: @ylli-selmani on GitHub.
The Game data editor (#7743, #7773) takes a checkpoint before every save, so a bad edit can be undone with Game controls → Checkpoints → Load. Every section it can edit is restored by that load except one: World Edits, the hand-edits layer over a game's world (
gameWorld.edits).Why it isn't covered yet
Checkpoints capture and restore a list of top-level metadata keys (
CHECKPOINT_GAME_METADATA_KEYSinpackages/server/src/services/game/checkpoint.service.ts). The edits layer isn't a top-level key: it lives insidegameWorld, and #7743 rules thatgameWorlditself is never written by hand. Restoring the layer also isn't just putting the value back.PUT /api/game/:chatId/world/editschecks a layer against the world, its towns and its story, and then re-saves the world snapshot (saveGameWorldSnapshot), rolling back if that fails. A load that sets the field directly would leave the snapshot describing the post-edit world.So until this is done, the World Edits section's description and
docs/game/sessions-and-saves.mdsay a checkpoint load doesn't undo World Edits.What a fix needs
gameWorld.editswith the checkpoint (null for a world without edits; nothing for a game without a world).PUT /world/edits: the world lock, the story check, and the snapshot re-save with its rollback. Not a direct metadata write.[docs-i18n]follow-up fordocs/game/sessions-and-saves.md(#7774).Found by CodeRabbit's review of #7773.
@ylli-selmani commented on GitHub (Oct 18, 2026):
One more consequence of this gap, from CodeRabbit's last review of #7773.
Since #7773, a checkpoint captures and restores the story script (
gameStory), but still not World Edits. So a load can bring back an older story while keeping newer World Edits. If those edits removed or renamed something the older story names (a place, a person a later edit took away), the restored story no longer fits the world.gameStoryFromMetadatathen reads it as null: the load reports success, but the story is silently inactive until someone fixes the script or the edits.Restoring World Edits together with the story should fix this, since both come from the same checkpoint and so fit each other. When this issue is picked up, it's worth a regression that loads a checkpoint after a later edit took away something the story names, and checks the story is playable afterwards (
gameStoryFromMetadatais not null).