Skip to content

Tier 3: ProjectionExpression syntax errors lack 'near:' source-window context #16

@hicksy

Description

@hicksy

Summary

ProjectionExpression syntax errors emit a shorter message than real DynamoDB: the source-window context (, near: "...") is missing. Surfaced by tier-3 exact-string assertions in the conformance suite.

Related to #12, but a different code path. Issue #12's UpdateExpression formatter lacks token quoting and near:; the ProjectionExpression formatter already quotes the token, so only the near: window is missing here.

Version: dynoxide 0.9.9

Cases

GetItem

Test: tests/tier3/error-messages/getItem.test.ts "invalid ProjectionExpression syntax: full parser error"

Expected:

Invalid ProjectionExpression: Syntax error; token: "!", near: "!!"

Actual:

Invalid ProjectionExpression: Syntax error; token: "!"

TransactGetItems

Test: tests/tier3/error-messages/transactGetItems.test.ts "invalid ProjectionExpression syntax: full parser error"

Same expected/actual as GetItem above. Request-level ValidationException, the parser rejects the expression before any per-action processing runs.

Reproduction

npx dynoxide@0.9.9 --port 8001 &
node -e '
import("@aws-sdk/client-dynamodb").then(async ({ DynamoDBClient, CreateTableCommand, GetItemCommand }) => {
  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 GetItemCommand({ TableName: t, Key: { pk: { S: "x" } }, ProjectionExpression: "!!! INVALID !!!" })); }
  catch (e) { console.log(e.message); }
});
'

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