Summary
Over-limit batch and transact requests emit messages that don't match the standard 1 validation error detected: ... envelope DynamoDB returns. Two distinct shapes diverge.
Version: dynoxide 0.9.9
Cases
BatchGetItem (> 100 keys) and BatchWriteItem (> 25 requests)
Tests:
tests/tier3/error-messages/batchGetItem.test.ts "> 100 keys across all tables: interpolated full error"
tests/tier3/error-messages/batchWriteItem.test.ts "> 25 requests: anchored regex on the constraint phrase"
Expected (BatchGetItem, exact):
1 validation error detected: Value at 'RequestItems.<table>.member.Keys' failed to satisfy constraint: Member must have length less than or equal to 100
Expected (BatchWriteItem, anchored regex around the Java-toString dump):
^1 validation error detected: Value '\{<table>=\[.+\]\}' at 'requestItems' failed to satisfy constraint: Map value must satisfy constraint: \[Member must have length less than or equal to 25, Member must have length greater than or equal to 1\]$
Actual (both):
Too many items requested for the BatchGetItem call
Too many items requested for the BatchWriteItem call
TransactGetItems (> 100 gets) and TransactWriteItems (> 100 actions)
Tests:
tests/tier3/error-messages/transactGetItems.test.ts "> 100 gets: anchored regex on the constraint phrase"
tests/tier3/error-messages/transactWriteItems.test.ts "> 100 actions: anchored regex on the constraint phrase"
Expected (anchored regex around the dump, both ops):
^1 validation error detected: Value '\[.+\]' at 'transactItems' failed to satisfy constraint: Member must have length less than or equal to 100$
Actual (both):
Member must have length less than or equal to 100
The constraint phrase is correct, but the 1 validation error detected: Value '...' at 'transactItems' failed to satisfy constraint: prefix is missing.
Reproduction
npx dynoxide@0.9.9 --port 8001 &
node -e '
import("@aws-sdk/client-dynamodb").then(async ({ DynamoDBClient, CreateTableCommand, BatchGetItemCommand, BatchWriteItemCommand, TransactGetItemsCommand, TransactWriteItemsCommand }) => {
const c = new DynamoDBClient({ endpoint: "http://localhost:8001", region: "us-east-1", credentials: { accessKeyId: "f", secretAccessKey: "f" } });
const t = "t" + Date.now();
await c.send(new CreateTableCommand({ TableName: t, AttributeDefinitions: [{ AttributeName: "pk", AttributeType: "S" }], KeySchema: [{ AttributeName: "pk", KeyType: "HASH" }], BillingMode: "PAY_PER_REQUEST" }));
const keys = Array.from({ length: 101 }, (_, i) => ({ pk: { S: `k-${i}` } }));
const writes = Array.from({ length: 26 }, (_, i) => ({ PutRequest: { Item: { pk: { S: `w-${i}` } } } }));
const tgets = Array.from({ length: 101 }, (_, i) => ({ Get: { TableName: t, Key: { pk: { S: `tg-${i}` } } } }));
const tputs = Array.from({ length: 101 }, (_, i) => ({ Put: { TableName: t, Item: { pk: { S: `tw-${i}` } } } }));
for (const cmd of [
new BatchGetItemCommand({ RequestItems: { [t]: { Keys: keys } } }),
new BatchWriteItemCommand({ RequestItems: { [t]: writes } }),
new TransactGetItemsCommand({ TransactItems: tgets }),
new TransactWriteItemsCommand({ TransactItems: tputs }),
]) {
try { await c.send(cmd); }
catch (e) { console.log(e.message); }
}
});
'
Summary
Over-limit batch and transact requests emit messages that don't match the standard
1 validation error detected: ...envelope DynamoDB returns. Two distinct shapes diverge.Version: dynoxide 0.9.9
Cases
BatchGetItem (> 100 keys) and BatchWriteItem (> 25 requests)
Tests:
tests/tier3/error-messages/batchGetItem.test.ts"> 100 keys across all tables: interpolated full error"tests/tier3/error-messages/batchWriteItem.test.ts"> 25 requests: anchored regex on the constraint phrase"Expected (BatchGetItem, exact):
Expected (BatchWriteItem, anchored regex around the Java-toString dump):
Actual (both):
TransactGetItems (> 100 gets) and TransactWriteItems (> 100 actions)
Tests:
tests/tier3/error-messages/transactGetItems.test.ts"> 100 gets: anchored regex on the constraint phrase"tests/tier3/error-messages/transactWriteItems.test.ts"> 100 actions: anchored regex on the constraint phrase"Expected (anchored regex around the dump, both ops):
Actual (both):
The constraint phrase is correct, but the
1 validation error detected: Value '...' at 'transactItems' failed to satisfy constraint:prefix is missing.Reproduction