Skip to content

fix(indexer): truncate errors at UTF-8 boundaries - #1223

Open
chriswessels wants to merge 1 commit into
graphprotocol:mainfrom
graphops:chris/qos-unicode-errors
Open

chriswessels wants to merge 1 commit into
graphprotocol:mainfrom
graphops:chris/qos-unicode-errors

Conversation

@chriswessels

Copy link
Copy Markdown

A valid GraphQL error whose UTF-8 character crosses byte 256 panics in String::truncate; for example, 255 ASCII bytes followed by é.

Truncate at the preceding character boundary while retaining the existing 256-byte limit. Tests cover two-, three-, and four-byte characters, a character ending exactly at the limit, ASCII truncation, and short messages.

Validation (on this independent branch):

  • cargo +nightly-2026-06-11 fmt --all -- --check
  • cargo +1.95.0 clippy --all-targets --all-features -- -Dwarnings --force-warn deprecated --force-warn dead-code
  • cargo +1.95.0 test

@chriswessels
chriswessels marked this pull request as ready for review October 29, 2026 13:48
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.

1 participant