Repository navigation
[BREAKING] Fix: wrong range query results for string bounds with astral characters or more code units than maxLength - #9554
Open
pubkey wants to merge 1 commit into
Conversation
pubkey
force-pushed
the
claude/vigilant-newton-8rqsab-astral-characters-break-index-string-alignment
branch
from
November 12, 2026 12:10
3670d3a to
af84d83
Compare
Contributor
|
…rs or more code units than maxLength Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015P6w6hnnyVPXwotts6YQ2F
pubkey
force-pushed
the
claude/vigilant-newton-8rqsab-astral-characters-break-index-string-alignment
branch
from
November 13, 2026 13:16
af84d83 to
bf1d233
Compare
This branch has not been deployed
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.
This PR contains:
Describe the problem you have without this PR
range queries on indexed string fields returned wrong documents on the storages with custom index strings (memory, localstorage, and others) when the queried value contains astral characters like emojis or is longer than the
maxLengthof the field. The stored index strings are not changed.Stored index strings are unchanged.
Breaking:
count()with a string bound that contains a surrogate pair (emoji) or is longer thanmaxLengthis now a slow count and throwsQU14withoutallowSlowCount: true.Not part of this PR: the sort order when one over-long value is a prefix of another, and compound indexes where a later field has its own bound.
Changed files:
orga/changelog/fix-astral-characters-index-string-range-queries.jsonsrc/custom-index.tssrc/query-planner.tstest/unit/rx-storage-query-correctness.test.tsTest output without the fix
The changed test file run on the memory storage with
src/frommaster:Test output with the fix
Todos
Assisted by
YES, CLAUDE CODE
Generated by Claude Code