Skip to content

Tier 3: UpdateExpression syntax errors lack token quoting and 'near:' context #12

@hicksy

Description

@hicksy

Summary

UpdateExpression syntax errors emit a shorter message than real DynamoDB: the offending token is not quoted, and the surrounding source window (near:) is missing.

Version: dynoxide 0.9.9

Test: tests/tier3/error-messages/updateItem.test.ts "invalid UpdateExpression syntax"

Expected:

Invalid UpdateExpression: Syntax error; token: "INVALID", near: "INVALID SYNTAX"

Actual:

Invalid UpdateExpression: Syntax error; token: INVALID

Reproduction

npx dynoxide --port 8001 &
node -e '
import("@aws-sdk/client-dynamodb").then(async ({ DynamoDBClient, CreateTableCommand, UpdateItemCommand }) => {
  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" }));
  try { await c.send(new UpdateItemCommand({ TableName: t, Key: { pk: { S: "x" } }, UpdateExpression: "INVALID SYNTAX HERE", ExpressionAttributeValues: { ":v": { S: "v" } } })); }
  catch (e) { console.log(e.message); }
});
'

Conformance run: https://github.com/nubo-db/dynamodb-conformance/actions/runs/24932177778

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingv0.9.10

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions