Repository navigation
fix(expressions): the in-memory backend refuses placeholders, names and operands DynamoDB refuses - #151
Merged
Conversation
Creates throwaway tables, asks the questions #87, #93, #97 and #106 leave open, logs every answer (with account ids masked) and deletes the tables. Co-authored-by: Carl Oscar Aaro <[email protected]>
Co-authored-by: Carl Oscar Aaro <[email protected]>
…ssages Co-authored-by: Carl Oscar Aaro <[email protected]>
…ndex does not hold DynamoDB refuses a query filter on attributes an index does not hold, for local indexes too and whatever the query returns, and a projection of a global index naming them (measured in eu-north-1, docs/parity). The in-memory backend now does the same with DynamoDB's messages, its scan filters see the index entries, and model reads raise ValueError before any request (ADR 0021). Co-authored-by: Carl Oscar Aaro <[email protected]>
…ack's Co-authored-by: Carl Oscar Aaro <[email protected]>
… parity-stack/2-index-reads
Co-authored-by: Carl Oscar Aaro <[email protected]>
…be round AWS CLI v1 base64-encodes the B values of JSON input itself, so the base64 text written for v2 became 400 KB items; the generators now write what the version in use sends as the intended bytes. Round 3 asks where LocalStack and the tests disagree. Co-authored-by: Carl Oscar Aaro <[email protected]>
…f fetched items are an assumption Co-authored-by: Carl Oscar Aaro <[email protected]>
…t, and add round 3 Co-authored-by: Carl Oscar Aaro <[email protected]>
… parity-stack/2-index-reads
Co-authored-by: Carl Oscar Aaro <[email protected]>
…t twice Co-authored-by: Carl Oscar Aaro <[email protected]>
… parity-stack/2-index-reads
…uses Measured in eu-north-1 (docs/parity): DynamoDB refuses a switch to provisioned billing without capacity for each global index, an index without capacity on a provisioned table, index capacity on an on-demand table, changes to a table it is still creating, and a second index while one is being created. The in-memory backend now does the same, drops index capacity on a switch back to on-demand, and keeps new tables and indexes CREATING until a DescribeTable sees them. table.add_index() gives an index of a provisioned table the table's capacity. Co-authored-by: Carl Oscar Aaro <[email protected]>
…n during a backfill follows DynamoDB's message Co-authored-by: Carl Oscar Aaro <[email protected]>
…be, so a lone describe does not end it add_index() without billing= describes the table, which ended CREATING in the in-memory backend and hid the missing wait DynamoDB refuses. A table or index being created now reads CREATING in the first DescribeTable and ACTIVE from the next on, as a poller sees it; the client's waiter polls the in-memory backend without sleeping. Co-authored-by: Carl Oscar Aaro <[email protected]>
Co-authored-by: Carl Oscar Aaro <[email protected]>
…ance never matches again A counter started again at 1 on a put() of an instance that was not loaded and on delete-and-create, so an instance loaded before passed its version check again and overwrote both writes (#84). Versions are now random tokens (Attr[str]), set on every write; transactions with an idempotency token derive theirs from it, so a retry is the same request (ADR 0022). BREAKING CHANGE: version() fields must be declared Attr[str] (Annotated[str | None, Version()] in pydantic models); stored numeric versions are not read. Co-authored-by: Carl Oscar Aaro <[email protected]>
… the model is used Co-authored-by: Carl Oscar Aaro <[email protected]>
Co-authored-by: Carl Oscar Aaro <[email protected]>
…nd operands DynamoDB refuses Measured in eu-north-1 (docs/parity): placeholders over 255 bytes or with invalid characters, attribute names of 64 KB or more, and attribute_type(a, b) with a path are refused, and a read-only ExecuteTransaction of a missing table is canceled with reason ResourceNotFound. Single-item writes put their expression errors and refused attribute names in DynamoDB's request-validation envelope, as dynoxide-rs captured. Co-authored-by: Carl Oscar Aaro <[email protected]>
This comment has been minimized.
This comment has been minimized.
… of each write Co-authored-by: Carl Oscar Aaro <[email protected]>
This was referenced Oct 31, 2026
Contributor
Author
|
Stack of 8 pull requests, merged in this order with "Squash and merge":
|
…its filter sees the entries Co-authored-by: Carl Oscar Aaro <[email protected]>
…describes its Time to Live DynamoDB refuses DescribeTimeToLive while it is creating a table (measured through the library probe on AWS); the in-memory backend now does too, and sync_with waits for the table first. Co-authored-by: Carl Oscar Aaro <[email protected]>
…essions # Conflicts: # CHANGELOG.md
…d what was probed Co-authored-by: Carl Oscar Aaro <[email protected]>
…not version 1 Co-authored-by: Carl Oscar Aaro <[email protected]>
…stack/2-index-reads # Conflicts: # CHANGELOG.md
…tack/2-index-reads
…tack/3-table-updates
…tack/5-expressions
…tack/5-expressions
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
The in-memory backend accepted expressions that DynamoDB refuses. Measured in eu-north-1 (docs/parity), DynamoDB refuses placeholder keys (
#name,:value) longer than 255 bytes ("The expression attribute map contains a key that is too long; size of key: 256") and keys with characters other than ASCII letters, digits and_("Syntax error; key: "#a-b"", also when unused; the memory backend reported#aas undefined). It refuses attribute names of 65,536 bytes or more, in an item and through a placeholder, andattribute_type(a, b)with a path as the type, with an operand type list that includes DynamoDB's internal types. It cancels a read-onlyExecuteTransactionof a missing table with reasonResourceNotFound(Nonefor the others), where the memory backend raisedResourceNotFoundException. The memory backend now does all of this with DynamoDB's messages.DynamoDB puts the expression and placeholder errors of
PutItem,UpdateItemandDeleteItem, and the attribute names they refuse in an item, in its request-validation envelope ("1 validation error detected: ..."), as dynoxide-rs captured in us-east-1 and eu-west-2 and rounds 1 and 2 confirmed (long names in items, maps and update placeholders, placeholder errors andattribute_typein writes). The memory backend sent them bare; now reads and transactions keep them bare, single-item writes put them in the envelope, and an update of a key attribute stays bare as dynoxide-rs records.Verified with
make check(the integration tests on the memory backend and MiniStack) and memory backend tests with DynamoDB's messages.Fixes #97
fctl session
Note
Low risk. It only changes the in-memory test backend and its expression checks, so code that talks to real DynamoDB is untouched, but error messages and one error class from that backend change for tests that match on them.
What it does. Makes the in-memory backend refuse what DynamoDB refuses: placeholder keys longer than 255 bytes or with characters other than ASCII letters, digits and
_, attribute names of 64 KB or more (in items and through placeholders), andattribute_type(a, b)with a path as the type. A read-onlyExecuteTransactionof a missing table is now cancelled with reasonResourceNotFound, and the expression and placeholder errors ofPutItem,UpdateItemandDeleteItemare wrapped in DynamoDB's1 validation error detected:envelope. The new behavior is covered by memory-backend tests and noted in the changelog anddocs/parity.Error messages change. Single-item writes now return
1 validation error detected:in front of their expression, placeholder and empty-name messages, and a readExecuteTransactionof a missing table raisesTransactionCanceledExceptioninstead ofResourceNotFoundException, so code or tests that match on the old text or class need a look.fctl review's first look at
6055dce· 9 files, +339 −16 · Review agent settings