Repository navigation
fix(aws): round-trip typed DynamoDB cursors and allow percentile-only CloudWatch statistics - #9967
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryPreserves DynamoDB cursor types and allows CloudWatch requests that ask only for percentiles.
|
There was a problem hiding this comment.
All reported issues were addressed across 8 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
… CloudWatch statistics
Encode large-number and binary keys in lastEvaluatedKey as {N}/{B} and decode
them in exclusiveStartKey, so pagination resumes on tables whose keys a JS
number or string cannot carry. Item output is unchanged. Let
get_metric_statistics take extendedStatistics alone: statistics is optional and
the contract requires one of the two.
Hold every N value a JS number cannot represent exactly as a NumberValue so the
cursor encodes it as {N}; item output keeps the same number/string rule.
…d-trips A decimal like 1.0000000000000000001 parses to a safe integer, so the safe-integer shortcut dropped its digits. Return a JS number only when String(parsed) equals the DynamoDB value (and it is not an unsafe integer); item output is unchanged.
|
@cubic-dev-ai review this PR |
409b866 to
fc0c438
Compare
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
Fixes from the v0.9.55 release review (#9963) that touch the AWS sweep (#9952/#9961).
lastEvaluatedKeyencoded integers a JS number can't hold, and binary keys, as plain strings. Passed back asexclusiveStartKey, they went out asS, so fetching the next page failed the key type check.{ N }/{ B }(key attributes are always scalar, so this can't collide with a real key value), andexclusiveStartKeydecodes them back toNumberValue/ binary.main, where these tables failed on page 1 (BigInt serialization).get_metric_statisticsaccepts percentile-only requests.statisticsis optional on the tool and in the contract, which now requires at least one ofstatistics/extendedStatistics.extendedStatisticsno longer fail the required-param check.ExtendedStatisticsstill takes precedence when both are set.Not changed: the review note on
dynamodb-get(expression attribute names without a projection) doesn't apply.tools/dynamodb/get.tsonly forwards names together with a projection, and the contract has no other caller.Type of Change
Testing
N/B, while strings and safe numbers are unchanged.vitestacross DynamoDB, CloudWatch, the AWS contracts, the stale-input test and the block tests: 45 passed.check-block-registry.ts origin/staging,check:tool-metadata,check:docs,check:integration-catalog,check:unused-exports,check:utils,check:test-patterns,check:explicit-any,check:api-validation:strictand biome pass./simplifyand/cleanuprun on the diff.Checklist
test-auditauthoring gate)