Skip to content

fix: preserve browser during permission refresh - #272

Merged
cxymds merged 1 commit into
mainfrom
cxymds/fix-browser-permission-refresh
Oct 19, 2026
Merged

cxymds merged 1 commit into
mainfrom
cxymds/fix-browser-permission-refresh

Conversation

@cxymds

@cxymds cxymds commented Oct 19, 2026

Copy link
Copy Markdown
Member

Pull Request

Description

Non-admin users entering Browser repeatedly lost the page because its forced bucket refresh also refreshed permissions, and the dashboard guard unmounted its children whenever permissions were loading. Completing that refresh mounted Browser again and restarted the cycle.

Gate the dashboard, sidebar, and first accessible route on completion of the initial policy load. Background refreshes retain the mounted page and navigation; a returned policy still re-evaluates route access. Keep the forced bucket/usage refresh and the provider's loading state for local indicators.

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

All local quality gates passed with Node 22:

pnpm install --frozen-lockfile
pnpm type-check
pnpm lint
pnpm format:check
pnpm test:run # 776 passed

Added 13 deterministic component tests using the real PermissionsProvider, DashboardAuthGuard, Browser page, and first-route hook with mocked I/O/presentation boundaries. They cover successful/denied policy-status probes, initial authorization, refresh revocation/failure, credential and API-client changes, logout/stale responses, administrators, readiness, manual refresh, and navigation. The regression tests failed against the original guard before the fix.

Automated Chromium checks against the local Next.js application with intercepted API/S3 responses confirmed:

  • Initial load settles at one bucket list, one policy-status probe, and two accountinfo requests; both denied and successful policy-status responses settle.
  • Manual refresh and returning to Browser still fetch fresh data.
  • Search input and its DOM node, desktop sidebar collapse state/home link, and mobile menu/focus survive background refreshes.
  • Loaded, empty, error/retry, mobile, and dark-theme states render without browser page errors. Mobile has no document-level horizontal overflow. Dark mode was selected through the Theme menu.

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

Closes #271

Screenshots (if applicable)

Actual local Console runtime with mocked non-admin API/S3 responses, not a live RustFS deployment. Each before/after pair captures the same pending background permission refresh: desktop 1440 × 900, mobile 390 × 844. Before, the refresh removes the application shell; after, the page and navigation remain mounted while usage refreshes.

View Before After
Desktop refresh Before desktop refresh After desktop refresh
Mobile refresh Before mobile refresh After mobile refresh
Additional loaded, empty, error, and mobile states
State Screenshot
Loaded Loaded buckets
Empty Empty buckets
Error with retry Bucket list error
Mobile loaded Mobile loaded
Mobile menu retained Mobile menu
Dark mode Mobile dark mode

Additional Notes

Independent Reviewer/Simplifier and UX audits found no blocking issues. The provider's identity epoch/reset logic and API-layer 401/403 logout handling are unchanged; ordinary policy-refresh failures still clear the policy and deny the protected route. Backend IAM remains authoritative while a background refresh retains the previous UI permission snapshot.

Screenshot assets are on the separate cxymds/evidence/issue-271-permission-refresh branch. The application diff contains only three permission-readiness changes and their regression tests. No live RustFS or OIDC end-to-end test was performed.

Use the first completed policy load to gate dashboard content so a forced Browser refresh cannot unmount its own page and start another refresh. Keep navigation stable while retaining authorization checks when the refreshed policy arrives.

Add component regressions for refresh stability, permission failures and revocation, identity changes, navigation, and administrator readiness.
@cxymds
cxymds merged commit 1483f7d into main Oct 19, 2026
10 checks passed
@cxymds
cxymds deleted the cxymds/fix-browser-permission-refresh branch October 19, 2026 01:31
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.

[BUG] Non-admin Browser page continuously remounts during permission refresh

1 participant