Repository navigation
refactor(db): one check for a refused conditional write - #658
Merged
Merged
Conversation
Seven hand-written tests of `error.name === "ConditionalCheckFailedException"`, in three different spellings, become `isConditionalCheckFailed` in src/lib/clients/database/errors.ts. It lives in its own module so that tests mocking the table clients still get the real check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Claude finished @alukach's task in 16s —— View job ✅ No blocking issues — safe to merge. (The PR is already merged.) I read the final state of the call sites. DocsNo docs, ADR or Simplify (ponytail)
💰 Estimated review cost: $0.12 · 0m15s · 6 turns |
Replaced usage of 'isConcurrentEdit' with 'isConditionalCheckFailed' for error handling in addProductMirror function.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Seven places checked by hand whether a DynamoDB write was refused by its
ConditionExpression, in three spellings (error instanceof Error && error.name === …,(error as { name?: string })?.name === …, and a localisConcurrentEdit). They now callisConditionalCheckFailedfromsrc/lib/clients/database/errors.ts:clients/database:accounts.ts,account-trusts.ts,data-connections.ts,products.tsactions:account.ts,service-accounts.ts,product-mirrors.ts(isConcurrentEditstays as a name for what the failure means there)The helper matches by name, as every copy did, so it also holds for the plain errors tests throw. It's in its own module rather than re-exported from
@/lib/clients, because several action tests mock that module with a factory and would otherwise getundefined.actions/data-connections.tsstill has its own two copies. #657 rewrites that file and replaces them with one inoperations/data-connections.ts, which will switch to this helper once this merges. Leaving the file alone here keeps the two PRs from conflicting.Docs and ADRs
No behavior change, so no docs, ADR or
llms.txtline is affected.Testing
npm run type-checkpasses.ConditionalCheckFailedException-named errors through these paths.🤖 Generated with Claude Code