Repository navigation
Description
Summary
The storage-operation surface of both the Python and JavaScript SDKs is fabricated. Every method returns invented data or reports success for work it never performs, and the READMEs document all of them as working. One of them overwrites a caller's local file with placeholder content.
This is the same class as the internal/* "success reported for failure" defects, except it is in a published client library where the caller has no way to notice.
JavaScript — sdks/javascript/src/storage.ts
| method | what it actually does |
|---|---|
listS3Objects |
returns two hardcoded objects, test-file-1.txt / test-file-2.txt, size: 1024 / 2048, etag: '"abc123"', keyed under whatever prefix the caller passed so the result looks derived from the request |
getS3ObjectInfo |
returns size: 1024, lastModified: '2024-01-01T00:00:00Z', etag: '"abc123"' for any key, including one that does not exist |
downloadS3Object |
fs.promises.writeFile(localPath, Buffer.from('Simulated file content from S3')) — writes 30 bytes of placeholder text over the caller's path, then invokes progressCallback(30, 30) and returns 30 as the byte count |
uploadS3Object |
console.log and return true. Nothing is uploaded. The progress callback is invoked with the local file's real size, so a progress bar completes normally |
deleteS3Object |
console.log and return true. The object is still in S3 |
parseS3Uri is real. Nothing else in the class is.
Python — sdks/python/objectfs/storage.py
The same five, same values: storage.py:279 (# In production, would use boto3 or similar), :330 (content = b"Simulated file content from S3"), :356, :365. Plus client.py:441 (# For now, simulate the operation). The duplicated copies under sdks/python/build/lib/ are a stale build artifact and should not be in the tree either.
Why it survived
downloadObjectis the dangerous one. A caller followingsdks/javascript/README.md:130passes/tmp/downloaded-file.txtand gets a file — of the wrong content, at the wrong length, with a byte count and a completed progress callback that both agree with each other. Point it at a real path and it destroys what was there.- No test exercises any of it.
sdks/javascripthas exactly one test file,src/prometheus.test.ts. There is notests/directory.sdks/javascript/README.md:122-150and:267-290documentlistObjects,downloadObjectanduploadObjectas the SDK's storage API. npm run buildhas never run in CI, sosrc/index.ts:32could export a name that does not exist (StorageAdapter, when the class isS3StorageAdapter) through a release. That is The JavaScript SDK has never compiled: 48 tsc errors, and CI never runs the build #314; this issue is what the same gap was hiding.
What to do
Two defensible options, and the choice is a product one:
- Implement them against
@aws-sdk/client-s3(JS) andboto3(Python). Both are the obvious dependency and neither is currently declared. This is the larger job and needs credential handling, pagination, and multipart. - Remove the surface and throw. Delete the methods, or keep the signatures and raise a
StorageErrornaming this issue, and cut the README sections. A caller then finds out immediately instead of after data loss.
Either way the current state cannot stay. I am doing (2) for the JavaScript side as part of the #314 work, because that PR is what makes storage.ts compile and therefore makes it shippable — a fabricated adapter that builds is worse than one that does not. The Python side and the real implementation are this issue.
Related: #314 (the JS SDK has never compiled, so no CI job would have caught any of this).
Activity
fix(sdks/python): the operations that fabricated data now raise
fix(sdks/javascript): export the error the client throws, and the rig…
fix(sdks/java): the Java SDK compiles, and its tests run
fix(sdks/c): the fourth SDK, where nothing had ever linked against th…
scttfrdmn commentedon Aug 3, 2026
State after #327: the dangerous half is fixed, the feature half is undecided
#327 lands option (2) from this issue's "What to do" — the honest throw — across all four SDKs, not the two this issue names. The Java and C SDKs were audited by going looking for the same structural gap and had their own defects; both are covered there.
What is no longer true of this issue:
downloadObject/_download_s3_objectno longer overwrite the caller's path with 30 bytes ofSimulated file content from S3. That was the data-loss hazard and it is gone in both SDKs, each pinned by a test that asserts an existing file at the target path is left untouched, each verified by restoring the fabrication and watching the test fail.gs://oraz://URI returned the same two invented S3 objects under a docstring describing a different cloud.--helptext now sayNOT IMPLEMENTEDwhere they previously documented these as working, including the README example that overwrote its own target.What remains — and is the whole of this issue now: option (1). Implement the storage operations against
@aws-sdk/client-s3andboto3, with credential handling, pagination and multipart, or delete the surface and cut the SDK sections entirely.That is a product decision rather than a defect, so I am dropping this from
priority: hightopriority: mediumand filing it under Future Work. The high priority was earned by the silent data destruction; with that fixed, a method that throws a typed error naming this issue is unpleasant but not dangerous, and nothing is now being lost while the decision waits.Worth stating plainly for whoever picks this up: neither SDK transfers bytes today, and both are published. The mount path and the Go SDK are the working clients. If the answer to option (1) is "no", deleting the surface is the smaller and more honest change.
[-]SDK storage operations are fabricated: downloadObject overwrites local files with placeholder content[/-][+]Implement the SDK storage operations against @aws-sdk/client-s3 and boto3, or delete the surface[/+]