You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Eliminate the silent error contract, decompose the god class, replace the internal AWS SDK middleware hack, and prepare the library to host extension packages (compress, cache, signed-URL fallback) — all while keeping the test suite green at every commit.
Why now
v3 error contract is broken in practice: 404s call res.writeHead() from inside the proxy and substitute an empty stream, so consumer error handlers either get headers-already-sent errors or never fire.
The AWS SDK middleware-stack hack uses undocumented internals with a load-bearing "not sure why" comment. One SDK upgrade away from breaking.
The current proxy.get(req, res) shape (writes resand returns the stream) blocks any clean extension model — compression, caching, signed-URL fallback all need an unwritten response to operate on.
Phase A — independent (no API changes; can ship incrementally)
Epic: 4.0 refactor
Goal
Eliminate the silent error contract, decompose the god class, replace the internal AWS SDK middleware hack, and prepare the library to host extension packages (compress, cache, signed-URL fallback) — all while keeping the test suite green at every commit.
Why now
res.writeHead()from inside the proxy and substitute an empty stream, so consumer error handlers either get headers-already-sent errors or never fire.proxy.get(req, res)shape (writesresand returns the stream) blocks any clean extension model — compression, caching, signed-URL fallback all need an unwritten response to operate on.Phase A — independent (no API changes; can ship incrementally)
Phase B — breaking refactor (4.0)
as any, add behavioral coverage, smoke-test examplesDependencies
Out of scope (4.1+)
@s3proxy/compress— gzip/brotli with Accept-Encoding negotiation, ETag invalidation, Range interaction@s3proxy/cache— disk/Redis with ETag-aware revalidation, Range support@s3proxy/signed-url-fallback— 302 to presigned URL above a size threshold (egress lever)Migration
A
MIGRATION.mdships in this PR with sed-able before/after for the Express handler, init() removal, and typed error catches.Discipline
This work is being executed under a one-shot prompt with non-negotiable rules:
it.skip, noit.only, no commented-out tests.simplifyskill runs at the end of every issue.Decision log
<append-only — date, decision, reason>