aws-amplify / aws-amplify/amplify-ui

Storage Browser cannot list or restore S3 object versions

Open
#7,116 3 comments 0 reactions 0 assignees View on GitHub
feature-request StorageBrowser
Dominant language
TypeScript
Stars
1.1k
Forks
347
Avg merge
18h 29m
Merged PRs (30d)
9

Description

### Before opening, please confirm:

- [x] I have searched for [duplicate or closed issues](https://github.com/aws-amplify/amplify-ui/issues?q=is%3Aissue).

### Which UI component?

Storage Browser

### Feature description

Storage Browser cannot show or act on S3 object versions. It can display the version id of the current object, but it cannot list earlier versions, download one, or restore one.

`FileMetadata.tsx` renders the id as one metadata row:

```ts
const { key, lastModified, versionId = NONE, size, eTag } = fileData;
...
{ label: versionIdLabel, value: versionId },
```

That value is read-only and describes the current object. `ListObjectVersions` does not appear anywhere in the repository, so the list of versions is never fetched.

### Why this matters

Versioning is what makes an accidental overwrite or delete recoverable, and it is a per-bucket setting an administrator turns on precisely so that end users are protected from their own mistakes. Today, enabling it on a bucket that is surfaced through Storage Browser changes nothing that a user can see or use — the safety net exists but is unreachable from the interface that is meant to give them access to that data.

The gap is easy to hit. A user uploads `report.pdf` over an existing `report.pdf`, realises it was the wrong file, and has no way back. The previous version is sitting in the bucket. Deleting is the same story: with versioning on, a delete writes a delete marker rather than destroying the object, and there is no way to see that or undo it.

Before opening this I looked for somewhere else to point people. There does not appear to be one. Desktop clients such as S3 Browser and Cyberduck handle versions, but they are applications rather than components. Among embeddable components, `tlinhart/s3-browser` and `blowfishpro/react-s3-browser` do not call `ListObjectVersions` either. Storage Browser is the most complete option available and it is also the only official one, which is why this seems worth raising here rather than working around.

### Suggested scope

The smallest useful version seems to be read-only, inside the file preview panel that already shows the version id:

1. A list of versions for the selected key — version id, last modified, size, and which one is current
2. Download a specific version

Two further steps, if the team wants them:

3. Restore a version, which is a `CopyObject` of that version onto the same key. The S3 guide describes this as the recommended way, since it preserves every version
4. Show a delete marker and allow removing it

Notes on how this fits the existing design:

- Permissions follow the same model as everything else in the component: `s3:ListBucketVersions` on the bucket and `s3:GetObjectVersion` on the objects, and restore additionally needs `s3:PutObject`. A location whose credentials lack them should simply not offer the feature, the same way other actions are gated today
- Nothing changes for a bucket without versioning. `ListObjectVersions` returns the single current version, so the panel can stay hidden rather than showing a list of one
- Existing users are unaffected: this is additive, and the version id row already present becomes the entry point rather than a dead end

I am happy to work on this if the team is open to the direction — I would rather agree on the shape first than send a PR that turns out to be the wrong one.

Contributor guide

Open the contributing guide

Research direction

Read FileMetadata.tsx and inspect the Storage Browser preview panel, existing action gates, and permission handling. Search the repository for ListObjectVersions and use the stated S3 permissions to map the integration. Done should mean an agreed version list with per-version download; restore and delete-marker behavior still need an explicit decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, react, typescript
Domain
cloud, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.