Skip to content

fix(code-reviews): sanitize summary and failure strings - #5822

Open
pandemicsyn wants to merge 2 commits into
mainfrom
investigate/sentry-1g3z
Open

fix(code-reviews): sanitize summary and failure strings#5822
pandemicsyn wants to merge 2 commits into
mainfrom
investigate/sentry-1g3z

Conversation

@pandemicsyn

@pandemicsyn pandemicsyn commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix KILOCODE-WEB-1G3Z: a NUL in a previous review summary makes PostgreSQL reject both summary persistence and the subsequent error-message write, leaving the review queued for repeated dispatch attempts.
  • Reuse the existing PostgreSQL string repair helper at both write boundaries, preserving nulls, valid Unicode, and literal escape sequences.
  • Add helper and real-database regression coverage for summary storage and successful failure terminalization.

Verification

No manual UI tests: this is a backend persistence fix verified through database-backed tests and static checks.

Automated Checks

  • pnpm --filter web exec jest --runInBand src/lib/sanitize-jsonb.test.ts src/lib/code-reviews/db/code-reviews.test.ts — 2 suites, 50 tests passed.
  • pnpm --filter web lint — passed.
  • pnpm --filter web typecheck — passed.
  • pnpm format on the four changed files and git diff --check — passed.

Visual Changes

N/A

Reviewer Notes

No schema migration. Reservation/status guards are unchanged. Independent static review completed: no code defects found. Its minor documentation note was corrected in a follow-up commit, and all targeted tests, lint, and typecheck passed again.

Sentry: https://kilo-code.sentry.io/issues/KILOCODE-WEB-1G3Z

@kilo-code-bot

kilo-code-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • apps/web/src/lib/sanitize-jsonb.ts
  • apps/web/src/lib/sanitize-jsonb.test.ts
  • apps/web/src/lib/code-reviews/db/code-reviews.ts
  • apps/web/src/lib/code-reviews/db/code-reviews.test.ts

Reviewed by grok-4.6 · Input: 115.9K · Output: 10.1K · Cached: 467.8K

Review guidance: REVIEW.md from base branch main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants