Repository navigation
Keep the video spec response encodable with a half-deleted emoji - #208
Merged
Merged
Conversation
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
marked this pull request as ready for review
October 15, 2026 01:42
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
A follow-up to #207, from the adversarial review of the spec path.
POST /api/video/specfailed for any note containing a lone UTF-16 surrogate, which is what a half-deleted emoji leaves behind (JSON.stringifystores 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:
source.block_ids. That affects nothing that renders, and it's left for the next follow-up.Test plan
pytest -qfrombackend/: 1,286 passed, 1 skipped (that skip was already there).🤖 Generated with Claude Code
https://claude.ai/code/session_01PwaujUokXQAxnebBArpZuj
Generated by Claude Code