mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8216] [MERGED] fix: reject malformed chat rosters before schema validation #8190
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#8190
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/8216
Author: @SpicyMarinara
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/chat-request-validation-hardening📝 Commits (3)
6c79d46fix: bound ordinary chat validation diagnosticsf6f14c1test: preserve large transfers while rejecting malformed chat rosters70ca79ftest: budget real chat transfer regression for CI📊 Changes
5 files changed (+231 additions, -3 deletions)
View changed files
📝
packages/server/src/middleware/error-handler.ts(+3 -1)➕
packages/server/src/routes/chat-request-validation.ts(+26 -0)📝
packages/server/src/routes/chats.routes.ts(+3 -2)➕
scripts/regressions/chat-request-validation.regression.ts(+197 -0)📝
scripts/run-regressions.mjs(+2 -0)📄 Description
Linked issue
Closes #8215
Why this change
Ordinary chat creation and settings updates should reject malformed roster data before allocating a schema issue for every invalid entry. Diagnostic responses also need to remain useful without echoing thousands of errors. This is assessed controller hardening; no authentication bypass or server crash is claimed.
What changed
POST /api/chatsandPATCH /api/chats/:id.Zod remains 3.25.76 in this focused patch. The separate major-version migration needs compatibility work; a version-only upgrade does not address unbounded validation by itself.
Validation
Local validation on exact head
70ca79f158dc32743ca4eeafc99056994d6163d6:pnpm checkpassed, including production client/server builds. One existingHomeProfessorMariChat.tsxhook-dependency warning remains.chat-request-validation.regression.tspassed: both real resource controllers reject all-invalid and first/last-invalid 10,000-entry rosters with zero schema element visits; the shared hook/schema accepts 10,001 valid IDs; both resource body budgets and the diagnostic cap are checked.large-native-json-importandcard-field-alternatives-importregressions passed. The existing regression-runner timeout-policy checks also passed.These are local in-process Fastify/real-storage checks. They do not claim network-authentication, browser/device or Docker execution. Hosted CI and Dottore Review remain merge gates.
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Manually verify ordinary chat creation and roster edits in the UI, then import and export representative large user data. Browser/device and local Docker validation were not performed for this backend-only patch.
Docs and release impact
No public UI/options, persistent storage format or release version changes. Existing transfer ceilings remain unchanged; this PR does not describe them as unlimited.
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.