Skip to content

fix: bypass client cache to fix cross-account migration - #39

Merged
brunozoric merged 2 commits into
mainfrom
bruno/fix/issue-30
Aug 28, 2026
Merged

fix: bypass client cache to fix cross-account migration#39
brunozoric merged 2 commits into
mainfrom
bruno/fix/issue-30

Conversation

@brunozoric

Copy link
Copy Markdown
Contributor

Summary

  • @webiny/aws-sdk's getDocumentClient and createS3Client cache clients by a hash of their config. When credentials is a function (e.g. fromAwsProfile), the hash is identical for source and target — so the target silently reuses the source's client.
  • DynamoDB: replaced getDocumentClient with direct DynamoDBClient + DynamoDBDocument.from() construction (no cache bypass option exists)
  • S3: passed cache: false to createS3Client (supported by the API)
  • Each source/target pair now gets its own client instance with the correct credentials

Closes #30

Test plan

  • yarn full passes (719 tests)
  • Existing integration tests still use the correct DDB client (dynalite endpoint)
  • Marshall options preserved (convertEmptyValues, removeUndefinedValues, convertClassInstanceToMap)

🤖 Generated with Claude Code

brunozoric and others added 2 commits August 28, 2026 10:11
…on (#30)

The cache in @webiny/aws-sdk hashes config objects with createCacheKey,
which serializes credential-provider functions to the same key. When
source and target use different AWS profiles (fromAwsProfile), the
target client was reusing the source's cached client.

- DynamoDbClient: create DynamoDBClient/DynamoDBDocument directly
  instead of using getDocumentClient (which has no cache-bypass option)
- S3Client: pass cache: false to createS3Client

Closes #30

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ders

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@brunozoric
brunozoric merged commit ac8c8ca into main Aug 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cache bug in S3 and DDB clients prevents cross-account migration

1 participant