mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2161] [Issue]: parseCharacterDisplayData drops JSON-string parsing and try/catch guard (name resolves to Unknown) #1070
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#1070
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 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2161
Originally assigned to: @cha1latte on GitHub.
Summary
The display-name resolver in the refactor only handles
raw.datawhen it is already an object. The legacy version also parsedraw.datawhen it arrived as a JSON string and wrapped resolution in try/catch so malformed payloads fell back to "Unknown" instead of silently losing the name.Expected behavior
Given a character whose
datais a JSON string (e.g. an unparsed DB/cache row),parseCharacterDisplayDatashouldJSON.parseit and resolve the real name, falling back to "Unknown" only on genuine failure.Actual behavior
The refactor does
raw.data && typeof raw.data === "object"only; a stringdatavalue is treated as non-object and the name resolves to "Unknown". The string path is still a live case in the refactor: sibling callers (ChatSettingsDrawer.tsx:1057,CreatorNotesCssInjector.tsx:51) still defensively runtypeof char.data === "string" ? JSON.parse(char.data) : char.dataon the same objects.Steps to reproduce
parseCharacterDisplayDatawith a character object whosedatafield is a JSON string (TTS config, tracker color manager, chat surface, setup wizards).Impact area
Environment
93555d4bRegression notes
Worked in legacy (main @
c49f1d95). main:packages/client/src/lib/character-display.ts:51-62(try/catch +typeof raw.data === "string" ? JSON.parse(raw.data) : raw.data). refactor @93555d4b:src/shared/lib/character-display.ts:120-126dropped both the JSON.parse and the try/catch.