mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5411] [MERGED] Return the raw stored text when an experience-state row fails to parse #6756
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#6756
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5411
Author: @kolacheee
Created: 8/22/2026
Status: ✅ Merged
Merged: 8/22/2026
Merged by: @kolacheee
Base:
staging← Head:feat/5407-rawstate📝 Commits (2)
1c5c876feat(game): return the raw stored text when experience state fails to parse70a731afix(game): log unreadable experience state at error severity📊 Changes
3 files changed (+175 additions, -7 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/server/src/routes/game.routes.ts(+41 -6)📝
scripts/regressions/experience-state.regression.ts(+133 -1)📄 Description
Linked issue
Closes #5407
Why this change
{ exists: true, state: null }and drops the raw text — so a package's correct repair (a replacing PUT) destroys the damaged bytes with no way to preserve them first, and a corrupt row is indistinguishable from a legitimately storednull.What changed
GET /api/game/:chatId/experience-state: when the stored value is unreadable, the response now carriesstateUnparseable: true(always-truthy corruption discriminator),rawState(the stored text, capped atMAX_EXPERIENCE_STATE_CHARS), andrawStateTruncated. Healthy rows are byte-identical to before — none of the three keys appear.statecolumn (a missing key reading back as null, or a hand-repaired shard holding a real object) is treated as corruption too — a 200 with a stringrawState(its JSON text), never a 500 and never a silentstate: nullmasquerading as legitimate. The catch path no longer re-assumes the type it exists to distrust.rawStatecan legitimately be falsy). Fail-first proven.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
experience-stateregression lane green (fail-first proven before the change);pnpm lint(typecheck, all 3 packages) green; prettier clean on touched files.format:checkon the whole tree false-fails in CRLF worktrees (pre-existing, environmental); CI on LF is authoritative.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Summary by CodeRabbit
Bug Fixes
nullvalues continue to be handled distinctly.Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.