BUG: S3 proxy client export breaks when s3Client is rebuilt #61

Closed
opened 2026-05-25 02:58:13 -04:00 by zgaetano · 1 comment
Owner

Fixed — the s3Client export is now a Proxy that dispatches every method call through the live _client, so callers continue to work after rebuildS3Client() swaps the underlying instance. Method binds preserve this. See services/mam-api/src/s3/client.js:35-45.

Fixed — the `s3Client` export is now a `Proxy` that dispatches every method call through the live `_client`, so callers continue to work after `rebuildS3Client()` swaps the underlying instance. Method binds preserve `this`. See `services/mam-api/src/s3/client.js:35-45`.
Author
Owner

Fix Plan — #61 S3 proxy client export breaks on rebuild

Root cause: s3/client.js exports s3Client as a Proxy (correct) BUT S3_BUCKET is a plain let export. Code that does import { S3_BUCKET } captures value at import time and won't see updates after rebuildS3Client().

Fix: Audit all imports of S3_BUCKET, replace with getter function:

// s3/client.js
export function getS3Bucket() { return S3_BUCKET; }

// everywhere else:
import { getS3Bucket } from "./s3/client.js";
const bucket = getS3Bucket();

Files: s3/client.js, all files importing S3_BUCKET
Effort: ~1h
**Priority: P2 — subtle bug

## Fix Plan — #61 S3 proxy client export breaks on rebuild **Root cause:** s3/client.js exports s3Client as a Proxy (correct) BUT S3_BUCKET is a plain let export. Code that does `import { S3_BUCKET }` captures value at import time and won't see updates after rebuildS3Client(). **Fix:** Audit all imports of S3_BUCKET, replace with getter function: ```js // s3/client.js export function getS3Bucket() { return S3_BUCKET; } // everywhere else: import { getS3Bucket } from "./s3/client.js"; const bucket = getS3Bucket(); ``` **Files:** s3/client.js, all files importing S3_BUCKET **Effort:** ~1h **Priority: P2 — subtle bug
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: WildDragonLLC/dragonflight#61
No description provided.