Repository navigation
fix: preserve completed usage and show initial scan progress - #317
Merged
Merged
Conversation
Use the explicit server snapshot view so first measurements can be shown without replacing completed statistics during later scans.
This was referenced Nov 23, 2026
cxymds
marked this pull request as ready for review
November 23, 2026 14:29
Keep account statistics, permissions, ownership, and loading state bound to the newest request so polling cannot overwrite a newer completed measurement.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A transient polling failure clears cached usage and policy state, discarding displayed measurements and incorrectly redirecting non-admin users to /403/ without a permission change.
1 open issue
What changed in this PR
This PR extends #316’s bucket statistics states with explicitly authorized initial-scan measurements, while prioritizing completed usage and adding periodic refreshes.
Changes:
- Request account snapshots and distinguish initial progress from completed measurements.
- Display localized partial-statistics labels in bucket lists and the overview.
- Refresh visible bucket pages every 30 seconds and extend parser tests and request fixtures.
| File | Description |
|---|---|
| tests/lib/bucket-usage-source.test.js | Update the expected display-usage helper. |
| tests/lib/bucket-scan-progress.test.ts | Cover initial authorization and completed-value precedence. |
| tests/hooks/use-permissions-refresh.test.ts | Update the snapshot request fixture. |
| tests/hooks/effective-permissions.test.ts | Update the permissions snapshot fixture. |
| lib/account-bucket-usage.js | Separate completed, initial, and display usage. |
| i18n/locales/zh-TW.json | Add Traditional Chinese scan labels. |
| i18n/locales/zh-CN.json | Add Simplified Chinese scan labels. |
| i18n/locales/vi-VN.json | Add Vietnamese scan labels. |
| i18n/locales/tr-TR.json | Add Turkish scan labels. |
| i18n/locales/ru-RU.json | Add Russian scan labels. |
| i18n/locales/pt-BR.json | Add Brazilian Portuguese scan labels. |
| i18n/locales/ko-KR.json | Add Korean scan labels. |
| i18n/locales/ja-JP.json | Add Japanese scan labels. |
| i18n/locales/it-IT.json | Add Italian scan labels. |
| i18n/locales/id-ID.json | Add Indonesian scan labels. |
| i18n/locales/fr-FR.json | Add French scan labels. |
| i18n/locales/es-ES.json | Add Spanish scan labels. |
| i18n/locales/en-US.json | Add English scan labels. |
| i18n/locales/de-DE.json | Add German scan labels. |
| i18n/locales/ar-MA.json | Add Arabic scan labels. |
| hooks/use-permissions.tsx | Request the account snapshot view. |
| components/buckets/usage-overview.tsx | Show initial subtotals when completed measurements are absent. |
| components/buckets/list.tsx | Label initial usage and schedule visible-page refreshes. |
| app/(dashboard)/browser/page.tsx | Integrate initial usage and retain overview values during account requests. |
Review effort: Balanced
Keep the last successful account snapshot on network and server failures while confirmed denials, malformed policy, and identity changes continue to invalidate it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Pull Request
Description
When a bucket has no completed usage measurement, show explicitly authorized first-scan progress with a concise “Initial statistics · Partial” state. Completed values take precedence during subsequent scans. Buckets without valid measurements retain the existing pending, loading, or unavailable states. Refresh visible bucket pages every 30 seconds without replacing retained values during background requests.
Type of Change
Testing
Passed locally on the submitted changes: frozen lockfile installation, type check, ESLint, Prettier, and all 1,270 tests (zero failures or skips). Regression coverage exercises explicit initial authorization, completed-value precedence, malformed progress, and background refresh.
Production build passed at 05c1eb2. Independent correctness, tester, simplification, and UX checks completed; controlled browser previews cover initial progress, completed-value precedence, mixed coverage, pending/loading/error/empty, Chinese/English, light/dark themes, and 390px mobile layouts. Background transient errors and out-of-order responses have deterministic regressions; confirmed denials remain fail-closed.
Checklist
Related Issues
User-reported scanner snapshot behavior on RustFS release/1.0.7 at 3dbcae5128fadb9e9ab10101dcebe83d162cb10e. Companions: rustfs/rustfs#9592 and rustfs/cli#433.
Screenshots (if applicable)
Controlled component previews, not live-cluster evidence. The before view uses the main-branch component; the after view uses this PR's actual overview and table cell implementations.
Other checked states: pending, loading, error, empty, mixed coverage, and mobile dark.
Additional Notes
Requests the optional accountinfo?view=snapshot view. Only initial_scan=true authorizes partial measurements. No new dependencies. The concise status and Next.js 16.4.6 upgrade from #316 are already on the base branch; this PR builds on that change. No live VM or production validation has been performed.