mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2619] [Issue]: /game/checkpoint/load drops fieldLocks and manualOverrides when cloning the restored snapshot #1291
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#1291
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 @Romuromylus on GitHub (Jun 18, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2619
Originally assigned to: @Romuromylus on GitHub.
Summary
Severity: Low — data-loss.
POST /game/checkpoint/loadclones the restored snapshot into a new committed game-state row but omitsfieldLocksandmanualOverridesfrom the clone. After a checkpoint restore the user's locked tracker fields are silently lost, and the next world-state/tracker agent run is free to overwrite fields the user had deliberately locked.Expected behavior
Restoring a checkpoint should preserve the tracker field locks and manual overrides that were in effect in that snapshot, so the lock feature keeps protecting those fields after a restore.
Actual behavior
game-state.storage.tscreate()persists bothstate.fieldLocks(~256) and the second-argmanualOverrides(~255), andschema/game-state.ts:29-31defines both columns.getByMessagereturns the raw row, sosnapshot.fieldLocks/snapshot.manualOverridesare available at the callsite but dropped. Downstream, generation reads the latest snapshot and runsapplyTrackerFieldLocksToGameStatePatch(updates, parseGameStateRow(latest))(generate.routes.ts:5432-5434,6014) to suppress tracker-agent writes to locked fields. After a restore the new latest row hasfieldLocks=null, so the lock filter is a no-op and the next run overwrites the previously-locked fields.updateByMessagethen re-propagates the empty locks.Steps to reproduce
Environment
staging @ 56f700cd(v2.0.0)Logs, screenshots, or video
Static source audit, cited to file:line above.
Additional context
Fix sketch. Include both when cloning the snapshot in checkpoint/load: parse
snapshot.fieldLocksviaparseTrackerFieldLocksand pass it on thecreate()state, and forward the parsedmanualOverridesas the secondcreate()argument, so locks/overrides survive a restore.Regression notes. Not a regression —
main's checkpoint/load body is byte-identical and also omits both. Notefield_locksis a staging-only column (main'sschema/game-state.tshasmanual_overridesbut nofield_locks), somainnever had field locks to drop; both branches dropmanualOverridesidentically.Template check
@Romuromylus commented on GitHub (Jun 18, 2026):
Fixed in #2623, merged to
staging(e1132e5b). Closing manually since the PR targetedstagingrather than the default branch.