Skip to content

Keep the video spec response encodable with a half-deleted emoji - #208

Merged
davior merged 1 commit into
mainfrom
claude/admiring-tesla-breov5
Oct 15, 2026
Merged

davior merged 1 commit into
mainfrom
claude/admiring-tesla-breov5

Conversation

@davior

@davior davior commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Summary

A follow-up to #207, from the adversarial review of the spec path.

POST /api/video/spec failed for any note containing a lone UTF-16 surrogate, which is what a half-deleted emoji leaves behind (JSON.stringify stores it as \ud83d). Once the note's JSON is decoded, it's a valid Python string but not valid UTF-8, so the JSON response couldn't be encoded and the request returned a 500 error.

The response's copy of the spec and warnings now has lone surrogates replaced with U+FFFD (�). Well-formed emoji pass through unchanged. Rendering is not affected: it keeps the text exactly as before, and the review confirmed that such a note renders identically through both paths.

Review status

The parity review has three stages:

Test plan

  • New test: a note with a lone surrogate gets an encodable response. The test fails with the fix removed and passes with it.
  • pytest -q from backend/: 1,286 passed, 1 skipped (that skip was already there).
  • CI green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PwaujUokXQAxnebBArpZuj


Generated by Claude Code

A lone UTF-16 surrogate, which a half-deleted emoji leaves in a note, is
a valid Python string but not valid UTF-8, so POST /api/video/spec
failed to encode its response for such a note. The response's copy now
has them replaced with U+FFFD; rendering keeps the text as it was.

Found by the adversarial parity review of the spec path, which found no
difference in what renders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PwaujUokXQAxnebBArpZuj
@davior
davior marked this pull request as ready for review October 15, 2026 01:42
@davior
davior merged commit 80aaf5d into main Oct 15, 2026
2 checks passed
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