fix(web): prevent invalid Unicode in API request logs - #4913
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change replaces the hand-rolled surrogate repair with Verification of previous findings
Notes
Files Reviewed (2 files)
Previous Review Summary (commit 09ea1f8)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 09ea1f8)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryThe new JSONB sanitizer correctly repairs unpaired UTF-16 surrogates, but it does not cover an escaped NUL code point (U+0000), which PostgreSQL Overview
Issue Details (click to expand)WARNING
SUGGESTION
Notes
Files Reviewed (3 files)
Reviewed by claude-opus-5 · Input: 20 · Output: 4.1K · Cached: 469.4K Review guidance: REVIEW.md from base branch |
marius-kilocode
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
String.prototype.isWellFormed()andtoWellFormed()with an allocation-free clean-string pathVerification
pnpm --filter web exec jest src/lib/rewriteModelResponse.test.ts src/lib/sanitize-jsonb.test.ts --runInBand --forceExitpnpm --filter web run typecheckpnpm exec oxlint --config .oxlintrc.json apps/web/src/lib/sanitize-jsonb.ts apps/web/src/lib/sanitize-jsonb.test.ts apps/web/src/lib/rewriteModelResponse.tspnpm formatgit diff --check