Skip to content

fix(core): send DynamoDB's text for a B value that does not decode - #1260

Open
LeeroyHannigan wants to merge 47 commits into
mainfrom
fix/1189-base64-texts
Open

LeeroyHannigan wants to merge 47 commits into
mainfrom
fix/1189-base64-texts

Conversation

@LeeroyHannigan

@LeeroyHannigan LeeroyHannigan commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Changes since the last review

What

For a B value or a BS member that does not decode as base64, ExtendDB now sends DynamoDB's text in the SerializationException. Before this change, the text was "Start of structure or map found where not expected: invalid base64: " and the decoder's error.

decode_base64 in crates/core/src/types/attribute_value.rs decodes with the same STANDARD decoder as before, so the values that decode do not change. For a value that does not decode, it gives DynamoDB's text by the length of the value in UTF-8 bytes:

Value Text
1 byte Buffer is too short for base64 encoding
== no message
any other length that is not a multiple of 4 Base64 encoded length is expected a multiple of 4 bytes but found: <length>
each byte before the closing = characters is in [A-Za-z0-9+/] Invalid last non-pad Base64 character dectected (DynamoDB's spelling)
any other value no message

The helper replaces three copies of invalid base64: {e}: the B arm of from_descriptor, binary_set, and check_base64 in crates/core/src/partiql/params.rs. This PR deletes check_base64.

serialization_exception in crates/engine/src/lib.rs sends these texts without the "Start of structure or map found where not expected: " prefix, and an empty text as no message. Other texts keep the prefix. deserialize_error, the PutItem read and the PartiQL parameter check call it.

In the tests, client_post in tests/raw_signed_request.py replaces _raw_query of tests/test_query_value_shapes.py. The new file tests/test_binary_base64.py uses it, and so does tests/test_query_leading_keys_values.py.

The v1.2.0 entry "a B value that does not decode gets the SerializationException text of DynamoDB" in docs/manuals/07-upgrade-manual.md gives the change for an upgrade.

The issue measured its three Query requests on the branch of #544, which was the base of this PR until #544 merged. On main at deed346, before #544, they got a ValidationException.

Why

Fixes #1189

DynamoDB's answers, measured in us-east-1 on 20 November 2026, each request twice with the same answer both times. The 49 requests went to a table that does not exist. There were 41 PutItem, 1 GetItem, 5 Query and 2 ExecuteStatement requests, each with a B value or a BS member. The 5 Query requests include the 3 requests of the issue.

B values DynamoDB
a, Y, ! Buffer is too short for base64 encoding
!!, YR, é (2 bytes in UTF-8) Base64 encoded length is expected a multiple of 4 bytes but found: 2
abcde, YQ== and a newline, Y Q== ... found: 5
Y===, YR==, YWJjYR==, YWF=, YWJj==== Invalid last non-pad Base64 character dectected
!!!!, YQ==YQ==, -_-_, YQ=A, !!==, YWJ!, éé, 😀 SerializationException with no message
YWJj, YQ==, YWE= ResourceNotFoundException: the value decodes

The text is the same for a value in a BS, an M or an L.

Later on 20 November 2026, between 17:14 and 17:15 UTC, 16 more PutItem requests went to a table that does not exist. Each request went out twice and got the same answer both times:

B values DynamoDB
= Buffer is too short for base64 encoding
Y=, != ... found: 2
===, A==, YR= ... found: 3
===== ... found: 5
====== ... found: 6
====, A===, AB==, AAB= Invalid last non-pad Base64 character dectected
==, and a BS with YQ== and !!!! SerializationException with no message
AA==, AAA= ResourceNotFoundException: the value decodes

On 25 November 2026, a PutItem with //== and one with ++== got Invalid last non-pad Base64 character dectected, each sent twice. tests/test_binary_base64.py has a row for each request of the two tables and of 25 November. The exceptions are the five values that DynamoDB reads, which "Not in this PR" names.

ExtendDB on #544 gave 3 of the 49 requests DynamoDB's answer: the 3 values that decode. With this change, 44 of the 49 get it, and so do the 16 later requests and the 2 of 25 November.

Conflicts

On 4 December 2026, git merge-tree compared cae2363 and main with each of the 221 open PRs. This PR adds a conflict with seven of them:

The v1.2.0 entry sits below the v1.2.0 entries of main in "Behavior Changes by Release" in docs/manuals/07-upgrade-manual.md, above the v1.1.0 entries. Other open PRs add their entries at the same place. Whichever PR merges second keeps both entries.

Not in this PR

DynamoDB accepts YQ, YQ=, Y=Q=, YWJjZA and YWJjZA=, and the decoder refuses them (#1258). With this change, ExtendDB still refuses them, with the text of their length or with no message.

Testing done

All runs below are on 7f2465d, the head before the merges of main. "Changes since the last review" gives the runs on the commits since the last review.

  • cargo +1.97.0 test -p extenddb-core --lib: 1147 passed, 1 ignored. cargo +1.97.0 test -p extenddb-engine --lib: 928 passed.
  • cargo +1.97.0 clippy -p extenddb-core -p extenddb-engine --all-targets -- -D warnings, the same for extenddb-engine with --features extenddb-engine/backup-test-hooks, the same for extenddb-core with --no-default-features, cargo +1.91.1 check -p extenddb-core -p extenddb-engine --all-targets and cargo +1.97.0 fmt --all -- --check are clean.
  • The base of this PR did not have main's WebAssembly workflow then. On a merge of 7f2465d with main, its clippy step, cargo +1.97.0 clippy --locked -p extenddb-wasm-adapter --lib --release --target wasm32-unknown-unknown -- -D warnings, is clean.
  • The unit table a_value_that_is_not_base64_gets_the_service_text holds 50 values. Each value goes through decode_base64, and through the deserializer as a B, a BS member, and a value in an M and an L. With decode_base64 changed back to the old text, this test and the params.rs test a_value_of_the_wrong_json_type_is_found_ahead_of_any_other_problem fail. With / left out of the last character rule, the test fails at //==, and with + left out, at ++==.
  • Against ExtendDB on SQLite, tests/test_binary_base64.py (47 rows), tests/test_query_value_shapes.py, tests/test_query_leading_keys_values.py, tests/test_partiql_requests.py and tests/test_attribute_value_validation.py passed 393 tests.
  • python3 -m pytest --collect-only -q collects 7013 tests in tests/ and 672 in tests/python with no error.

The line counts count the Python files and the Rust lines of an inline test module as tests. At cae2363 against main: production +58 -30, tests +261 -34, docs +14 -0.

Checklist

  • I have read CONTRIBUTING.md
  • All tests pass (cargo test --workspace)
  • Code is formatted (cargo fmt --check)
  • Clippy is clean (cargo clippy -- -W clippy::pedantic)
  • I have added or updated tests for new functionality
  • I have updated documentation if behavior changed
  • Breaking changes are noted below (if any)
  • If this changes the wire protocol, Storage trait, auth model, on-disk
    format, or public CLI surface, an RFC has been accepted or is linked
    below. Otherwise, an ADR captures the decision (link below).

ADR / RFC: n/a

Breaking changes

A request with a B value or a BS member that does not decode still gets a SerializationException. Its message is now DynamoDB's text, or no message. Before, the message was "Start of structure or map found where not expected: invalid base64: " and the decoder's error. A client that reads the old text gets the new one. The values that decode and the stored data do not change. The v1.2.0 entry of docs/manuals/07-upgrade-manual.md gives the change.


By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.

LeeroyHannigan and others added 24 commits October 24, 2026 23:36
…rules

A Query with a KeyConditionExpression did not check a key condition value's
type against the key attribute's AttributeDefinitions type, and did not check
that an N value in ExpressionAttributeValues is a number. The storage layer
compared the value's inner text with the stored key and ignored the type tag,
so {"N": "bob"} on an S partition key read the bob partition while
authorization bound no dynamodb:LeadingKeys value to it, and a sort key value
of another type answered InternalServerError on SQLite.

Add the two checks the service applies before it reads a row, on the
expression path (crates/engine/src/query_key_values.rs):

- an N value in ExpressionAttributeValues that is not a number answers
  "The parameter cannot be converted to a numeric value: <value>" (the
  overflow and 38-digit texts for those cases; an empty value answers the
  message with the colon). The check covers the whole map, including NS
  members and values nested in L and M, whether the key condition, the
  filter or nothing reads them, with the walk PutItem and UpdateItem already
  use. It runs at request time after the Limit and expression parameter mix
  checks and before the table lookup, which moves those two checks ahead of
  the table lookup as well. The server runs the same request-time checks
  ahead of the IAM decision, so a principal under any LeadingKeys fence form
  gets ValidationException and no items;
- a key condition value whose type is not the key attribute's type answers
  "One or more parameter values were invalid: Condition parameter type does
  not match schema type", for the partition key, the sort key under every
  comparison operator, both BETWEEN bounds, the begins_with prefix and
  multi-attribute index keys, after the key schema, filter, projection,
  unused value and Select checks and before the ExclusiveStartKey check. When
  a compared placeholder is undefined the check returns without a verdict and
  the undefined placeholder is reported.

Measured on the service on 2026-10-24 (113 requests, each sent twice). The
legacy KeyConditions path is unchanged; its checks land with #507. Scan is
unchanged. Unit tests at the checks and a dual-target wire test file,
tests/test_query_key_value_types.py, which fails on main.
… service's order

The server ran its pre-IAM checks only when the body deserialized as
QueryInput, and the engine checked the ReturnConsumedCapacity and Select
enums before them, so a Query carrying an invalid Select and an N value
that is not a number answered the Select message, or AccessDeniedException
for a principal whose LeadingKeys fence needs a value. The checks now read
the raw body in the service's order, measured 2026-10-24: Limit, the
expression and non-expression parameter mix, ReturnConsumedCapacity, every
number in ExpressionAttributeValues, then Select. The engine and the server
run the same function.
…ort a shape fault ahead of the request-time checks

The request-time number check refused an N value written with a Unicode
decimal digit (fullwidth, Arabic-Indic, Devanagari) that the service accepts
as the digit it stands for, so a Query that returns rows on the service
answered ValidationException here. The check now folds every general
category Nd digit to ASCII before the number rules run and echoes the value
as the request wrote it when the rules refuse it; the Nd zero code points of
Unicode 15.0 live in a module of their own. The fold applies to the check
only: the handler and the server's key binding read the value as written.
The write paths are unchanged.

The checks run on the raw body before deserialization, so a field of the
wrong JSON type elsewhere in the body (a string ExpressionAttributeValues
beside a Limit of 0, a string ExpressionAttributeNames beside a malformed N,
a numeric Select) answered the check's ValidationException where the service
and the previous release answered SerializationException. When a check fails,
the body is now deserialized as the typed input and a SerializationException
from that is returned instead; a ValidationException the deserializer raises
does not preempt the check, and a body that passes every check is not
deserialized twice. The server's call before dispatch goes through the same
function.

Measured against the service on 2026-10-25 (11:31 UTC) on tables with S/N
and S/S keys, each request twice. Unit tests cover the digit table, the
folded check and the shape-fault order; the wire file gains the measured
rows for both.
…ks, and assert only acceptance for Unicode digits

The shape-fault pass returned the deserializer's SerializationException for an
AttributeValue with an unknown type descriptor, so Limit 0 beside {"X": "1"}
changed class. The service answers the Limit ValidationException for that
body (measured 2026-10-25), and the check's answer is returned again.

The Unicode digit tests asserted that a key condition or filter written with
a Unicode digit reads the item stored with the ASCII digit. This change makes
the request-time check accept such a value; it does not change how the
handler reads it, so the tests assert only that the value is accepted. A new
test checks that a partition key value written with Unicode digits returns no
item of a partition a ForAllValues LeadingKeys fence keeps the caller from.
Conflict in crates/server/src/request_helpers.rs (authorize_request): main
moves the ARN shape checks and the GetRecords iterator decode ahead of the
dev-mode return. The resolution keeps the main version and puts the Query
request checks of this branch after the tag ARN shape check and before
validate_operation_arns. Thus the Query checks also run in dev mode.
Main changes resolve_multipart to take the HASH and the RANGE attribute
names (#429). The multi-attribute HASH test now gives r as the RANGE
attribute, as its attribute definitions do.
…l as the service does

On a single-attribute key schema, the later check of this branch now reports a
wrong type in a key condition expression, as the service does. The early check
from main still runs there for legacy KeyConditions, which the later check
skips. The begins_with refusal now reads the type of the value instead of the
type of the sort key.
…rder comments

Two new rows send begins_with with an N value on an attribute that is not in
the key schema. One row uses a table with an S sort key and the other uses a
table with an N sort key. The service refuses both requests with the
begins_with operand type message.

The comments in handle_query now say that the classifier checks the values of
legacy KeyConditions. They also say which attribute definitions it uses for
each kind of key schema. The doc of resolve_key_schema_with now says where the
service reports a wrong type on a single-attribute key schema (measured
2026-11-06).
…rder

- Report an invalid ReturnConsumedCapacity ahead of the expression and
  non-expression parameter mix.
- Check the numbers in each ExpressionAttributeValues entry on its own. A
  value that does not deserialize no longer turns the check off for the
  others, in the handler and before authorization.
- Beside a value the service cannot read as one type, answer in the
  service's order. Such a value is a null, or holds no known type
  descriptor, more than one, or an unknown one beside a known one. Select,
  ReturnConsumedCapacity and Limit come together, with the Limit text that
  names the value. The parameter mix comes next, then the first value with
  a fault and its placeholder. A value the service cannot read comes ahead
  of a number fault in another value.
- In the shape fault check, replace only the parts of such a value that the
  service cannot read. A field of the wrong JSON type in the rest of the
  value still answers SerializationException.
- Count a decimal digit only below U+10000, as the service does. The check
  refuses a digit from U+104A0 up.
- Echo a refused number with each decimal digit folded to ASCII.
- Add rows for legacy KeyConditions and for a multi-attribute key schema
  beside a non-key clause. Skip the second type check where the classifier
  checked the values.
- Delete the LeadingKeys test tables when a call raises.
- Give the checks for values the service cannot read their own module and
  tests. Move the request order unit tests and the shape fault and
  LeadingKeys Python tests to files of their own.
The comment above the Query request checks in authorize_request said
that they run for every principal. They run after the cross-account
refusal, so a table ARN in another account gets AccessDeniedException
without them. The service runs them first for a body it can read. Main
has the same order for every Query check, and the call does not move.
The comment now states this.

The comment above the key value type gate in handle_query now states
the service's order for legacy KeyConditions. For a legacy value of the
wrong type on a single-attribute key schema, the service reports the
projection, Select, filter, QueryFilter and unused-value checks first.
The classifier's check answers ahead of them, as on main.

The doc comment of the Query number check is about the
ExpressionAttributeValues contains invalid value wrapper. It said that on
Query the service adds the wrapper only for a value it cannot read as one
type. The service also adds it beside a Limit above 2147483647 (measured
2026-11-12), and the comment now says so.

validate_key_condition_types now calls check_key_value_type for each
value it compares. This removes type_matches and resolve_attr_name,
which repeated check_key_value_type and resolve_path_attr_name.
check_key_value_type returns KEY_CONDITION_TYPE_MISMATCH in place of a
second copy of the text. No answer changes.

validate_attribute_number in the core validation module is private
again. An earlier commit of this branch made it public, and nothing
outside that file calls it.
first_fault returned the more than one datatypes text as soon as a value
held two type descriptors. It did not read their payloads. The service
reads every payload first. On Query, the service gives one answer for
:v set to {"N": "bob", "S": "x"} and for {"S": "x", "N": "bob"}. The
answer is "ExpressionAttributeValues contains invalid value: The
parameter cannot be converted to a numeric value: bob for key :v".
{"N": "1", "S": "x"} answers the more than one datatypes text. The
service names a null or an empty value inside an L beside an S in the
same way. It reads N ahead of NS, and NS and M ahead of L, in either
member order (each request measured twice on 2026-11-19).

first_fault now reads the payloads in the order of TYPE_DESCRIPTORS,
which agrees with those pairs. It returns the more than one datatypes
text only when no payload has a fault.

The doc comment of the Query number check said that the service adds
the wrapper on UpdateItem. On the service, :v set to {"N": "bob"} in
UpdateItem gets no wrapper, in SET a = :v and in a ConditionExpression
that reads :v. The answer is "1 validation error detected: The
parameter cannot be converted to a numeric value: bob". The comment no
longer names UpdateItem.
The request-time Query checks had no ExpressionAttributeNames step, so an
invalid names key beside {"N": "bob"} answered the numeric text. The
service and main answer `ExpressionAttributeNames contains invalid key:
Syntax error; key: "a"`.

validate_names runs the ExpressionAttributeNames deserializer on the raw
body and returns its ValidationException. Both paths of the checks call it
after the parameter mix and ahead of the values.

The service checks in the same order: it reports a Limit of 0, an invalid
ReturnConsumedCapacity and the mix ahead of an invalid key. The key comes
ahead of an N value that is not a number and of a duplicate NS. It also
comes ahead of an invalid Select and of a value the service cannot read as
one type. With KeyConditions and no KeyConditionExpression, the service
still reports the key. Each request went to the service twice on
2026-11-19, with the names map first and last in the body.
On Query, {"S": null} beside an invalid Select answered
`SerializationException: S value must be a string`. The request checks
read {"S": null} as an S, so the Select check failed. The shape fault check
then read the S payload as a JSON type fault. Main answers the Select text,
as the service does.

The service reads a type descriptor with a null payload as absent. To the
service, {"S": null} is a value it cannot read as one type, and the request
takes that order of checks. Beside an invalid Select it answers the Select
text. Beside a Limit of 0 it answers the Limit text that names the value.
Alone it answers `ExpressionAttributeValues contains invalid value:
Supplied AttributeValue is empty, must contain exactly one of the supported
datatypes for key :v`. The service accepts {"S": null, "N": "1"} in a
FilterExpression. Each request went to the service twice on 2026-11-19.

unreadable counts a type descriptor with a null payload as a part the
service cannot read, while first_fault and make_readable skip it.
On Query, an empty name in ExpressionAttributeNames beside a value the
service cannot read as one type answered the empty name text. The service
answers the value's text. For {"#a": ""} beside {"X": "1"} it answers
`ExpressionAttributeValues contains invalid value: Supplied AttributeValue
is empty, must contain exactly one of the supported datatypes for key :x`.
Beside {}, {"N": "1", "S": "x"}, a null and {"S": null}, the same names map
answers that value's text. Beside {"X": "1"}, {"#a": "", "b": "c"} answers
`ExpressionAttributeNames contains invalid key: Syntax error; key: "b"`.
Beside {"S": "a", "X": "1"}, which has no fault of its own, {"#a": ""}
answers the empty name text. Each body went to the service twice, with the
names map first and last, on 2026-11-19.

On that path the service checks the keys of the names map ahead of the
values. Those checks refuse an invalid key, a key over 255 bytes and an
empty map. The service makes the empty name check after the values.
unreadable_value_checks now runs the key checks ahead of the values. It
runs them through the same deserializer, with each name replaced. The whole
names check runs after the values.

The unit tests share one set of message texts, and the names tests are one
table of rows. The handler and pre-IAM comments point to
validate_query_request_body, whose doc lists the order of the checks.
The doc of validate_query_request_body said that the service makes the
request-time checks first on a Query that names a table ARN in another
account. The measurement covers a body the service can read, and the
doc now says so.

The doc of validate_names now lists the check on a key over 255 bytes,
which the deserializer makes and which validate_name_keys names. Step 5
of the unreadable_value_checks doc is three sentences. The first list in
the docstring of TestExpressionAttributeNamesOrder now covers readable
values only. The docstring also gives the place of the key checks beside
a value the service cannot read. No code or test row changes.
ExtendDB answered a B value that does not decode as base64 with the
decoder's error text. The text followed the prefix "Start of structure
or map found where not expected:".

DynamoDB answers such a value with a SerializationException and a text
of its own, measured in us-east-1 on 20 November 2026. The text depends
on the length of the value in UTF-8 bytes. One byte gets "Buffer is too
short for base64 encoding". The value "==" gets no message. Other
values whose length is not a multiple of 4 get "Base64 encoded length is
expected a multiple of 4 bytes but found: n". Otherwise, a value whose
bytes before its closing "=" run are base64 characters gets "Invalid
last non-pad Base64 character dectected". Any other value gets no
message.

One helper now decodes a B value, a BS member and a PartiQL parameter,
and gives these texts. The engine sends them without the prefix, and an
empty text as no message. The values accepted do not change.

Fixes #1189.
The previous commit moved _raw_query out of test_query_value_shapes.py
as client_post in raw_signed_request.py. test_query_leading_keys_values.py
still imported _raw_query, so the wire suite failed to collect. It now
imports client_post and sends its Query row through it.
Main is at c8e66fb, three commits past e8b5f10: #1465, #1515 and
#1411. #1411 adds a v1.2.0 entry at the top of "Behavior Changes by
Release" in docs/manuals/07-upgrade-manual.md, above the entry of #606.
Git merged the file with no conflict, so the order is #1411, #606, then
the entry of this branch. No other file has changes on both sides.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
Add a v1.2.0 entry at the top of "Behavior Changes by Release" in
docs/manuals/07-upgrade-manual.md, above the entries of main and #1260.
It gives the values that 1.1.0 refused and this branch reads, the bytes
they store, and the requests that still need the padding.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
The base brings main at c8e66fb through #1260, with #1465, #1515 and
#1411, and adds the v1.2.0 entry of #1313 to
docs/manuals/07-upgrade-manual.md. The merge has no conflict, and no
file has changes on both sides.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
The base brings main at c8e66fb through #1260, with #1465, #1515 and
#1411, and adds the v1.2.0 entry of #1313 to
docs/manuals/07-upgrade-manual.md. Git merged the manual with no
conflict. The order of the v1.2.0 entries is #1313, #1411, #606, #1260,
then the entry of this branch. No other file has changes on both sides.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
The base brings main at c8e66fb through #1260, with #1465, #1515 and
#1411, and adds the v1.2.0 entries of #1313 and #1355 to
docs/manuals/07-upgrade-manual.md. The merge has no conflict, and no
file has changes on both sides.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
The base brings a new BatchWriteItem check. It reads a fault ahead of a
B in request order, also inside a value. The base also adds a sentence
to its v1.2.0 entry. The merge has no conflict. Git merged the upgrade
manual, where both sides changed other lines. The base adds the new
sentence to the entry of #1313. This branch has its entry below the
entry of #1260. No other file has changes on both sides.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
The v1.2.0 entry of #1260 ended with "An ImportTable line with such a
value keeps its 1.1.0 answer, Invalid DynamoDB item at line N". The
entry of this branch says that such a line now ends the reading of its
file. The sentence in the entry of #1260 now gives the 1.1.0 answer and
the new one. The request answers HTTP 200, and the import ends FAILED.

The entry of this branch now also says what a file that starts with a
UTF-8 byte order mark gets. The reader does not take U+FEFF as JSON, so
the reading ends at line 1 and the import ends FAILED. No measured file
started with a byte order mark.
@navareamol navareamol self-assigned this Dec 3, 2026

@LJMart11 LJMart11 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked at 2044c36 against the list from 639ff59.

This follow-up merges main again and adds the v1.2.0 upgrade-manual entry for the new SerializationException texts of a B value that does not decode. Confirmed: tests/test_binary_base64.py passes 47 of 47 on PostgreSQL and on SQLite; with is_base64_refusal disabled at crates/engine/src/lib.rs:260, 44 of the 47 fail and 3 pass, so the suite pins the branch; extenddb-core and extenddb-engine tests pass on the merged head (1261 and 981 unit tests, 0 failed).

Previous items: 1 fixed.

@navareamol navareamol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit test comment says every value in the table was measured on 2026-11-20 or 2026-11-25. I think 12 of the 50 values are not in the description or in tests/test_binary_base64.py: =, Y=, !=, ===, A==, YR=, ====, =====, ======, A===, AB== and AAB=. Their answers come from the rule in decode_base64. For example ==== gets "Invalid last non-pad Base64 character dectected" only because trimming the = signs leaves nothing, and the other all-= values get the length text. Has anyone measured these on the live service? If yes, can they go in the wire file with the date? If not, can the comment stop saying they were measured?

The description counts 49 measured requests, 41 of them PutItem. tests/test_binary_base64.py has 47 rows and 39 PutItem. Which two requests are not in the file, or is the count off?

On a build of this head, all 31 request shapes I tried (item, key, ExpressionAttributeValues, Expected, ScanFilter, ExclusiveStartKey, transactions, batch and PartiQL parameters) give the same text for the same value, so I have no finding there.

I will approve once the 12 values are measured or the comment no longer claims they were.

Main is at b6c8595, three commits past c8e66fb: #1446, #1531 and
#1466. #1446 and #1531 add two v1.2.0 entries at the top of "Behavior
Changes by Release" in docs/manuals/07-upgrade-manual.md, above the
entry of #1411. Git merged the file with no conflict. The order is
#1531, #1446, #1411, #606, then the entry of this branch, which does
not change. No other file has changes on both sides.
The unit table a_value_that_is_not_base64_gets_the_service_text holds
14 values that tests/test_binary_base64.py did not have: AA==, AAA=, =,
Y=, !=, ===, A==, YR=, =====, ======, ====, A===, AB== and AAB=. The
unit test also checks a BS with YQ== and !!!!, which had no row either.

DynamoDB answered a PutItem with each of these on 20 November 2026,
from 17:14 to 17:15 UTC, on a table that does not exist. Each request
went out twice and got the same answer both times. AA== and AAA=
decode and get ResourceNotFoundException. The other values and the BS
get the text of the unit table. The wire file now has a row for each,
so each of the 50 values of the unit table has a row there.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
The base brings main at b6c8595 through #1260, with #1446, #1531 and
#1466. It also brings the 15 new rows of #1260 in
tests/test_binary_base64.py.

One file conflicted: docs/manuals/07-upgrade-manual.md. #1446 and #1531
add two v1.2.0 entries at the top of "Behavior Changes by Release",
where this branch adds its entry. The merge keeps the two entries of
main first, then the entry of this branch, then the entry of #1313.
Git merged tests/test_binary_base64.py at other lines. No other file
has changes on both sides.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
The base brings main at b6c8595 through #1260, with #1446, #1531 and
#1466, and the 15 new rows of #1260 in tests/test_binary_base64.py.
The merge has no conflict. Git merged the upgrade manual, where both
sides changed other lines. The base adds the two entries of main above
the entry of #1313, and this branch has its entry below the entry of
#1260. No other file has changes on both sides.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
The base brings main at b6c8595 through #1260 and #1313, with #1446,
#1531 and #1466. It also brings the 15 new rows of #1260 in
tests/test_binary_base64.py.

One file conflicted: docs/manuals/07-upgrade-manual.md. #1446 and #1531
add two v1.2.0 entries at the top of "Behavior Changes by Release",
where this branch adds its entry. The merge keeps the two entries of
main first, then the entry of this branch, then the entry of #1355.
No other file has changes on both sides.
@LeeroyHannigan

Copy link
Copy Markdown
Collaborator Author

@navareamol

  1. Yes. All 12 went to DynamoDB in us-east-1 as PutItem requests on a table that does not exist. That was on 20 November 2026, between 17:14 and 17:15 UTC, and each request went out twice with the same answer both times:

    Value DynamoDB
    = Buffer is too short for base64 encoding
    Y=, != Base64 encoded length is expected a multiple of 4 bytes but found: 2
    ===, A==, YR= ... found: 3
    ===== ... found: 5
    ====== ... found: 6
    ====, A===, AB==, AAB= Invalid last non-pad Base64 character dectected

    The same run sent AA== and AAA=, two values of the table that decode, and they got ResourceNotFoundException. It also sent the BS with YQ== and !!!! from the end of the unit test, which got no message. You are right that none of these were in the description or in the wire file. 5885e20 adds the 15 rows to tests/test_binary_base64.py under a comment with the date. Now each of the 50 values of the unit table has a row there. The description lists them in a second dated table. The unit test comment does not change, because each of its values has a dated measurement.

  2. The count is right. Five of the 49 requests are not in the file: the PutItem requests with YQ, YQ=, Y=Q=, YWJjZA and YWJjZA=. DynamoDB reads these values and answers ResourceNotFoundException, and this PR still refuses them, as "Not in this PR" says. fix(core): read a B value with its padding left out or cut short #1313 adds the rows of YQ, YQ=, YWJjZA and YWJjZA=, and fix(core): read a B value with "=" or another character inside #1355 adds the row of Y=Q=. Three rows of the file come from other requests: == from the run at 17:14 UTC on 20 November, and //== and ++== from 25 November. So the file had 49 - 5 + 3 = 47 rows, and 41 - 5 + 3 = 39 of them PutItem. With the 15 new rows it has 62, and 54 of them are PutItem.

The branch also merges main at b6c8595 in 6927648, with no conflict.

@LJMart11

LJMart11 commented Dec 3, 2026

Copy link
Copy Markdown

Checked at 2044c36 against the list from 639ff59. The head moved again to 5885e20; this reviewer stops after two rounds and leaves the rest to a person.

Fixed:

  • item 1

Disputed: none.

Needs-human: none.

Main is at 5826e1b, one commit past b6c8595: #1087. #1087 adds its
v1.2.0 entry to "Behavior Changes by Release" in
docs/manuals/07-upgrade-manual.md after the other v1.2.0 entries of
main, where this branch has its entry. That is the one conflict. The
merge keeps both entries without change: the entry of #1087 first, then
the entry of this branch, before the v1.1.0 entries. No other file has
changes on both sides.

This branch has not been deployed

No deployments
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.

A B value that is not valid base64 answers serde's text in its SerializationException, where DynamoDB names the length

3 participants