Skip to content

fix(utilization): hide usage when array is stopped - #2734

Open
Eli Bosley (elibosley) wants to merge 1 commit into
masterfrom
fix/stopped-array-utilization
Open

fix(utilization): hide usage when array is stopped#2734
Eli Bosley (elibosley) wants to merge 1 commit into
masterfrom
fix/stopped-array-utilization

Conversation

@elibosley

@elibosley Eli Bosley (elibosley) commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

A stopped array can report 100% utilization because the UI treats missing free-space data as zero; this hides usage percentages until the array is started.

Why This Exists

When the array stops, filesystem size can remain available while free-space metrics are absent. The existing fallback converts the missing value to zero, which makes the used-space formula render 100%. This appears in the navigation usage bar and pool filesystem rows.

Resolution

Require the array state to be Started before rendering utilization. Stopped arrays now show offline or filesystem status text, while started arrays keep the current usage display.

Reviewer Considerations

  • The guard is intentionally state-based because stopped-array metrics are incomplete even when a boot or pool filesystem remains mounted.
  • The same source change applies to the master and 7.3 release lines.
  • This change does not alter filesystem metrics or started-array calculations.

Behavior Changes

Stopped arrays no longer show a usage percentage in the navigation bar or filesystem rows. Started arrays behave as before.

Implementation Summary

  • Gate the navigation usage bar on fsState=Started.
  • Gate filesystem usage bars on fsState=Started.
  • Add a regression test for stopped and started rendering behavior.

Verification

  • php tests/stopped-array-utilization.php
  • php -l emhttp/plugins/dynamix/include/Helpers.php
  • php -l emhttp/plugins/dynamix/nchan/device_list
  • php -l tests/stopped-array-utilization.php
  • git diff --check

Risk

Low; the change only suppresses usage rendering while the array is stopped and preserves the existing status output.

Linear

Related to OS-803: https://linear.app/lime-technology/issue/OS-803/733-stopped-array-shows-100percent-utilization
Related to OS-804: https://linear.app/lime-technology/issue/OS-804/740-stopped-array-shows-100percent-utilization

Summary by CodeRabbit

  • Bug Fixes

    • Usage bars and filesystem capacity details are now shown only when the array is started and filesystems are mounted.
    • Stopped arrays now correctly display offline status without utilization percentages or usage bars.
  • Tests

    • Added regression coverage to verify utilization behavior for both stopped and started arrays.

@github-actions

Copy link
Copy Markdown

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.08.24.1701
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2734/webgui-pr-2734.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates
  • Post-merge behavior: This preview stays available after merge until preview storage expires or it is manually cleaned up

📝 Modified Files:

Click to expand file list
emhttp/plugins/dynamix/include/Helpers.php
emhttp/plugins/dynamix/nchan/device_list

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2734, or run:

plugin remove webgui-pr-2734

🤖 This comment is automatically generated and will be updated with each new push to this PR.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7a0412d6-5329-444d-88eb-4c11e05eceb8

📥 Commits

Reviewing files that changed from the base of the PR and between 995cc85 and ae9fdbe.

📒 Files selected for processing (3)
  • emhttp/plugins/dynamix/include/Helpers.php
  • emhttp/plugins/dynamix/nchan/device_list
  • tests/stopped-array-utilization.php

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Walkthrough

The change gates filesystem utilization output on the Started state. A regression test verifies that stopped arrays show status text without utilization metrics, while started arrays retain the metrics.

Changes

Filesystem utilization gating

Layer / File(s) Summary
Gate utilization rendering by filesystem state
emhttp/plugins/dynamix/include/Helpers.php, emhttp/plugins/dynamix/nchan/device_list
my_usage() and fs_info() now show utilization metrics only when the filesystem state is Started.
Validate stopped and started array output
tests/stopped-array-utilization.php
The regression test evaluates the production functions with helper stubs and checks stopped and started array output.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to ae9fd

This localized change hides utilization percentages only for stopped arrays while preserving started-array behavior and status text; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: simonfair

Poem

A rabbit checks the array’s green light,
No bars appear when disks sleep tight.
When started, percentages hop in view,
Filesystem status stays clear and true.
“Thump!” says the rabbit, “The test checks too.”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: hiding utilization usage when the array is stopped.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/stopped-array-utilization

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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