Skip to content

fix(r2): memoize S3Client and validate env vars - #82

Open
waterlemonnn wants to merge 1 commit into
AgentPostmortem:mainfrom
waterlemonnn:fix/45-memoize-r2-client
Open

fix(r2): memoize S3Client and validate env vars#82
waterlemonnn wants to merge 1 commit into
AgentPostmortem:mainfrom
waterlemonnn:fix/45-memoize-r2-client

Conversation

@waterlemonnn

Copy link
Copy Markdown
Contributor

What

Ensures that the R2 S3Client is memoized across hot reloads in development by attaching it to \globalThis. Also adds strict validation for R2-related environment variables before instantiating the client to prevent cryptic runtime errors deep in the AWS SDK.

Closes #45

Checks

  • \pnpm tsc --noEmit\ — clean

Ensures that the R2 S3Client is memoized across hot reloads in development
by attaching it to globalThis. Also adds strict validation for R2-related
environment variables before instantiating the client to prevent cryptic
runtime errors deep in the AWS SDK.

Closes AgentPostmortem#45
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.

Memoize the R2 S3Client and validate its environment variables with readable errors

1 participant