Skip to content

feat: calculate folder statistics on demand - #284

Open
houseme wants to merge 3 commits into
mainfrom
houseme/issue-9082-prefix-summary
Open

houseme wants to merge 3 commits into
mainfrom
houseme/issue-9082-prefix-summary

Conversation

@houseme

@houseme houseme commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Description

Folder rows previously showed no size or modification time. Users can now calculate both on demand from current visible objects under the literal S3 prefix. The latest modification time is the newest object timestamp, not a native folder timestamp.

The scan runs only when requested, supports cancellation, and stops at 100 pages or 100,000 objects. Errors and incomplete results are not shown as successful statistics. The interface states both limits. Loaded rows without a result retain their existing objects, avoiding unnecessary per-row copies when a summary changes. A list-level status keeps cancellation and outcomes accessible when filtering, sorting or virtual scrolling hides the selected row; late results after cancellation are ignored. Like S3 pagination, the calculation is not a point-in-time snapshot.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Test improvements

Testing

  • Unit tests added/updated
  • Manual testing completed

At commit 3ffa56e0a9581c810f6f0caeb44249b7fbc674b5, using Node 22.23.4 and pnpm 12.3.4:

corepack pnpm install --frozen-lockfile
corepack pnpm type-check
corepack pnpm lint
corepack pnpm format:check
corepack pnpm test:run
git diff --check

All passed; the test suite ran 868 tests. Tests cover pagination, encoded literal prefixes, cancellation, invalid responses, limits, stale results after cancellation, filtering, a scope change or refresh, and status dismissal. A local browser test against an isolated debug RustFS build at d8d064bd1 calculated the expected 40 B and latest object time for the test prefix. This does not replace multi-node or concurrent-write testing. A local ABBA microbenchmark of mapping 10,000 loaded rows with one summary reduced that isolated step by roughly 16–18%; it does not measure end-to-end latency or S3 performance.

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

Related to rustfs/rustfs#9082 and rustfs/backlog#2981.

Screenshots (if applicable)

Same test bucket and viewport before and after; screenshots use isolated local test data. On mobile, the existing table requires horizontal scrolling to see the full timestamp.

Before After
Desktop before Desktop after
Mobile before Mobile after

Filtered-row status on desktop and mobile was also verified with an intentionally delayed local S3 request. Chinese mobile was verified; long translated strings were not manually verified.

Additional Notes

The existing scanner usage endpoint counts versions and may be partial or use normalized paths, so it is not used for this current-object calculation. The Console change must be released and incorporated into a RustFS distribution before users receive it.

Calculate current object size and latest modification time only when requested, with bounded pagination and cancellation.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
houseme and others added 2 commits October 31, 2026 14:42
Avoid cloning every loaded row when prefix statistics change, and explain the page limit alongside the object limit.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Keep progress and outcomes available when filtering, sorting, or virtual scrolling hides the scanned row, and ignore responses that arrive after cancellation.

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

This branch has not been deployed

No deployments
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