Skip to content

Fix stale asset usage meter - #4293

Open
seb-prjcts-be wants to merge 1 commit into
processing:developfrom
seb-prjcts-be:codex/fix-asset-usage-meter
Open

Fix stale asset usage meter#4293
seb-prjcts-be wants to merge 1 commit into
processing:developfrom
seb-prjcts-be:codex/fix-asset-usage-meter

Conversation

@seb-prjcts-be

Copy link
Copy Markdown

Issue:

Related to #4085.

The asset usage meter currently prefers user.totalSize, which is loaded with the authenticated session and can become stale after assets are uploaded or deleted. Although the asset-list request returns the current storage total and the assets reducer updates that total after deletion, the meter can continue displaying the older session value. The same precedence can also keep the upload-limit message stale after the asset list has loaded.

Demo:

No screenshot included. This is a state-source correction and requires conflicting session and asset-list totals to reproduce.

Changes:

  • use assets.totalSize as the asset meter's current source of truth
  • initialize the assets total as undefined so the meter remains hidden until the asset request completes
  • prefer the loaded assets total in the upload-limit selector
  • use nullish fallback so an exact 0 B total does not restore a stale positive session value

This pull request contains one commit and changes only three existing client files. It does not include shared-asset-library changes.

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • has no typecheck errors (npm run typecheck)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123
  • meets the standards outlined in the accessibility guidelines

git diff --check passed. I did not mark the dependency-based checks as complete because this fresh checkout does not contain node_modules.

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