mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3857] [Issue]: Fresh chat tag filters miss tags because API returns raw metadata strings #2084
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#2084
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 @Xelvanis on GitHub (Jul 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3857
Originally assigned to: @SpicyMarinara on GitHub.
Summary
After a fresh load, chat tag filtering and search can omit existing tags because
GET /api/chatsreturns file-storage rows whosemetadataandcharacterIdsfields are JSON strings, while the sharedChatcontract and client query treat them as parsed values.The same storage/transport mismatch exists for message
extra, characterdata, and several persona fields. This leaves components maintaining local parsers and makes the shared response types unreliable.Expected behavior
HTTP responses typed as shared
Chat,Message,Character, orPersonavalues should match those contracts: JSON-backed fields should arrive as parsed arrays/objects and string-backed booleans as booleans. Storage row representations should remain internal.Actual behavior
chats.storage.list()returns raw file-table rows and the/chatsroute forwards them.useChats()castsres.json()directly toChat[].ChatSidebar.getChatTags()only reads object metadata, so fresh string metadata yields no tags.Steps to reproduce
GET /api/chats.Environment
Logs, screenshots, or video
No logs or screenshots. Static trace:
packages/server/src/services/storage/chats.storage.tsreturns raw chat rows.packages/server/src/routes/chats.routes.tsforwards them.packages/client/src/hooks/use-chats.tstypes the response asChat[]without normalization.packages/client/src/components/layout/ChatSidebar.tsxonly extracts tags from object metadata.Additional context
This is a broader transport-boundary issue rather than only a sidebar bug. A durable direction would be to add canonical row-to-domain mappers at the server response boundary for chats, messages, characters, and personas, keeping file-storage row types internal. Shared raw transport DTOs are only preferable if storage-shaped HTTP payloads are intentionally supported.
Persona create/update schemas should be handled as a related but separable validation change.
Related closed issue: #2801 fixed one cache-corruption symptom caused by the same raw-string metadata boundary, but the list response remains storage-shaped. The broader storage audit in #2028 did not resolve this contract mismatch.
No data loss was confirmed. Current impact is inconsistent UI behavior, misleading shared contracts, and duplicated client parsing.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jul 20, 2026):
SpicyMarinara is taking this issue in the current assigned-issue sweep. I’m tracing the reported boundary, adding focused regression coverage, and will link the draft PR here as soon as the proof commit is pushed.
@SpicyMarinara commented on GitHub (Jul 20, 2026):
Implementation is now tracked in draft PR #3862 against
staging.@SpicyMarinara commented on GitHub (Jul 20, 2026):
Addressed in #3862 and merged to staging as
ca6d0c15be.