Skip to content

Implement the SDK storage operations against @aws-sdk/client-s3 and boto3, or delete the surface #325

Closed

Description

@scttfrdmn

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

  • downloadObject is the dangerous one. A caller following sdks/javascript/README.md:130 passes /tmp/downloaded-file.txt and 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/javascript has exactly one test file, src/prometheus.test.ts. There is no tests/ directory. sdks/javascript/README.md:122-150 and :267-290 document listObjects, downloadObject and uploadObject as the SDK's storage API.
  • npm run build has never run in CI, so src/index.ts:32 could export a name that does not exist (StorageAdapter, when the class is S3StorageAdapter) 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:

  1. Implement them against @aws-sdk/client-s3 (JS) and boto3 (Python). Both are the obvious dependency and neither is currently declared. This is the larger job and needs credential handling, pagination, and multipart.
  2. Remove the surface and throw. Delete the methods, or keep the signatures and raise a StorageError naming 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

  1. added
    type: bug
    priority: high
    area: sdk
    on Aug 3, 2026
  2. scttfrdmn commented on Aug 3, 2026

    @scttfrdmn
    OwnerAuthor

    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_object no longer overwrite the caller's path with 30 bytes of Simulated 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.
    • The count was higher than this issue recorded: fifteen fabricating methods on the Python side, not five. The GCS and Azure backends were copies that called the S3 method, so a gs:// or az:// URI returned the same two invented S3 objects under a docstring describing a different cloud.
    • Both READMEs and the Python --help text now say NOT IMPLEMENTED where they previously documented these as working, including the README example that overwrote its own target.
    • All four SDKs now compile and are gated in CI, so this surface can no longer change without something running the compiler over it.

    What remains — and is the whole of this issue now: option (1). Implement the storage operations against @aws-sdk/client-s3 and boto3, 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: high to priority: medium and 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.

  3. added
    priority: medium
    type: enhancement
    and removed
    priority: high
    on Aug 3, 2026
  4. added this to the Future Work milestone on Aug 3, 2026
  5. removed
    type: bug
    on Aug 3, 2026
  6. changed the title [-]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[/+] on Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: sdkpriority: mediumtype: enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions