Skip to content

fix: handle readonly bucket states safely - #188

Merged
cxymds merged 1 commit into
mainfrom
cxymds/fix-readonly-bucket-browser
Jul 28, 2026
Merged

fix: handle readonly bucket states safely#188
cxymds merged 1 commit into
mainfrom
cxymds/fix-readonly-bucket-browser

Conversation

@cxymds

@cxymds cxymds commented Jul 28, 2026

Copy link
Copy Markdown
Member

Pull Request

Description

Fix readonly bucket browsing so permission-limited S3 responses are represented accurately instead of redirecting users or inventing trusted state.

  • Keep users on the bucket page when HeadBucket returns 403; only redirect for a definitive missing bucket response.
  • Show unknown access policy as - when GetBucketPolicyStatus cannot be read instead of incorrectly labeling the bucket private.
  • Keep GetBucketVersioning fail-closed for deletion safety without showing the generic Failed to get data banner.
  • Distinguish object-list 403 and load failures from a confirmed empty bucket.
  • Add an announced DataTable error state and preserve the upstream filtered-empty behavior.

The root cause was that independent permission failures were being collapsed into unrelated states: 403 from HeadBucket triggered navigation, policy-status failure became false, and object-list failure became an empty result.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test improvements
  • Security fix

Testing

  • Unit tests added/updated
  • Manual testing completed
pnpm install --frozen-lockfile
pnpm tsc --noEmit
pnpm lint
pnpm test:run
pnpm prettier --check <changed files>
git diff --check

373 tests pass. TypeScript, ESLint, changed-file Prettier, lockfile sync, and diff checks pass.

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • TypeScript types are properly defined
  • All commit messages are in English (Conventional Commits)
  • All existing tests pass
  • No new dependencies added, or they are justified

Related Issues

None.

Screenshots (if applicable)

Not included; the error states require permission-specific S3 responses.

Additional Notes

The full-repository pnpm prettier --check . currently reports a pre-existing formatting issue in app/(dashboard)/sse/page.tsx. That file is not changed by this PR; all files changed here pass Prettier.

@cxymds
cxymds marked this pull request as ready for review July 28, 2026 09:52
@cxymds
cxymds merged commit 68a47f1 into main Jul 28, 2026
10 checks passed
@cxymds
cxymds deleted the cxymds/fix-readonly-bucket-browser branch July 28, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant