Repository navigation
fix(expressions): characters outside ASCII are syntax errors, not panics - #65
Merged
kalaspuff merged 2 commits intoOct 30, 2026
Merged
Conversation
The expression lexer reported an unexpected character with a span of one byte, so a character outside ASCII (`größe > :v`, or a non-breaking space pasted into `a = :v`) made the error message slice into the middle of it and panic. In-memory calls raised an internal error, and `_core._apply_update()` and `_core._check_expressions()` raised a PanicException, which `except Exception` does not catch. AWS clients failed the same way before sending UpdateItem, whose expression the core parses to decide whether a retry is safe. The span now covers the whole character: such expressions are syntax errors (ValidationException), and AWS clients send them to DynamoDB. Co-authored-by: Carl Oscar Aaro <[email protected]>
kalaspuff
force-pushed
the
fixes-stack/05-non-ascii-expressions
branch
from
October 30, 2026 21:17
2935030 to
d22860f
Compare
…cii-expressions # Conflicts: # CHANGELOG.md
This was referenced Oct 30, 2026
Closed
Closed
Closed
Table updates: provisioned billing without index throughput, and calls while a table is changing
#87
Closed
This was referenced Oct 30, 2026
Closed
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.
What and why
A character outside ASCII anywhere in an expression panicked the expression lexer. It reported an unexpected character with a span of one byte, and building the error message then sliced into the middle of a multi-byte character. Inputs that triggered it:
größe > :v, a non-breaking space pasted intoa = :v,SET a = :v, ü = :v, or the projectiona, ñ.DynamoxyError: internal error: a dynamoxy task panickedinstead of aValidationException.dynamoxy._core._apply_update()(which dynamoxy uses to refresh instances) and_core._check_expressions()raisedpyo3_runtime.PanicException, aBaseExceptionthatexcept Exceptiondoes not catch.UpdateItem, because the core parses update expressions to decide whether a retry is safe. The request never reached DynamoDB, which would have answered with an error of its own.The span now covers the whole character, so these expressions are syntax errors with DynamoDB's message (
Invalid ConditionExpression: Syntax error; token: "ö", near: "größe"). An AWS client that cannot parse an update expression sends it to DynamoDB, and does not resend it after an attempt that may have been applied.Verified with a new Rust test (conditions, updates and projections with characters outside ASCII), a Python test that failed with the
PanicExceptionbefore the fix (_check_expressions,_apply_update, and anUpdateItemon the in-memory backend), and the whole Rust and Python suites, clippy, ruff, pyrefly and the consistency checks.Checklist
make checkpasses locally (lint, types, clippy, consistency, Rust and Python tests)fctl session
Note
Low risk. It changes one error path in the expression lexer, which only runs for expressions that were already invalid, and adds tests.
What it does. The expression lexer reported an unexpected character as one byte wide, so a character outside ASCII (
größe > :v, or a non-breaking space) made the error message slice into the middle of it and panic. The span now covers the whole character, so such expressions give a normalValidationExceptionsyntax error instead of an internal error or aPanicException, and AWS clients no longer fail while parsingUpdateItemexpressions for the retry check. Tests in Rust and Python and a changelog entry are included.fctl review's first look at
db41758· 4 files, +53 −1 · Review agent settings