Skip to content

fix(shares): allow setting Emptying disk(s) while array is Started#2686

Closed
elibosley wants to merge 2 commits into
masterfrom
fix/allow-share-emptying-while-array-started
Closed

fix(shares): allow setting Emptying disk(s) while array is Started#2686
elibosley wants to merge 2 commits into
masterfrom
fix/allow-share-emptying-while-array-started

Conversation

@elibosley

@elibosley elibosley commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

The Global Share Settings page locked every control whenever the array was not Stopped, including Emptying disk(s) (shareUserEmptying) — even though emhttpd accepts the emptying command at runtime and does not require the array to be stopped.

This splits "Emptying disk(s)" into its own form at the bottom of the page (mirroring the two-form pattern already used in NFS.page), so it can be changed independently while the array is Started. The main settings form remains fully locked while the array is not Stopped.

Why a separate form (vs. one form)

The page is a single markdown definition-list form and "Emptying disk(s)" sat in the middle of the stop-required settings. A dedicated form:

  • posts only shareUserEmptying to /update.htm — no reliance on "disabled fields aren't submitted"
  • has its own Apply button and explicit, self-documenting submit semantics
  • stays editable while the array is Started, gated only on user shares being enabled

Changes

  • emhttp/plugins/dynamix/ShareSettings.page
    • New share_emptying form at the bottom with the "Emptying disk(s)" control + its own Apply (posts to /update.htm with changeShare, identical backend path to the existing form).
    • prepareEmptying() collapses the multi-select for submit; emptying collapse removed from prepareShare().
    • presetShare() gates the emptying control only on user shares being enabled (not array state).
    • Main form footer note reverted to the original "Array must be Stopped to change".
  • emhttp/languages/en_US/helptext.txt
    • Added the previously missing :shares_emptying_disks_help: entry.

Testing

  • Array Started: main settings locked; "Emptying disk(s)" editable; selecting a disk enables its Apply; applying writes only shareUserEmptying.
  • Array Stopped: all settings editable, unchanged behavior.
  • User shares = No: "Emptying disk(s)" disabled (nothing to empty).

Linear

Resolves OS-495 — https://linear.app/lime-technology/issue/OS-495

The Global Share Settings form locks every control whenever the array is
not Stopped. The 'Emptying disk(s)' setting (shareUserEmptying), however,
is accepted by emhttpd at runtime, so gating it on array state is an
unnecessary UI restriction.

Decouple shareUserEmptying from the array-state lock in presetShare(),
gating it only on user shares being enabled, and add the previously
missing help text for the field. Other settings remain locked while the
array is Started.
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 13 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 94f01162-22bd-45a4-9d22-865608458bfb

📥 Commits

Reviewing files that changed from the base of the PR and between 369f0b2 and 24f3c19.

📒 Files selected for processing (2)
  • emhttp/languages/en_US/helptext.txt
  • emhttp/plugins/dynamix/ShareSettings.page
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/allow-share-emptying-while-array-started

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

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

🔧 PR Test Plugin Available

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

Version: 2026.07.03.0352
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-2686/webgui-pr-2686.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/languages/en_US/helptext.txt
emhttp/plugins/dynamix/ShareSettings.page

🔄 To Remove:

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

plugin remove webgui-pr-2686

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

Rather than keeping 'Emptying disk(s)' inside the array-state-locked
Global Share Settings form and relying on disabled fields not being
POSTed, move it into a dedicated form at the bottom of the page with its
own Apply button (mirrors the two-form pattern in NFS.page).

The emptying form posts only shareUserEmptying to /update.htm, is always
editable while user shares are enabled regardless of array state, and
makes the submit semantics explicit. The main form reverts to locking
all of its settings while the array is not Stopped.
@elibosley

elibosley commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

Closing — we won't be doing this in 7.4.0

Per discussion with Tom: this is a larger change than it appears on the surface. Unlocking "Emptying disk(s)" at the UI level isn't sufficient — FUSE / the user file system needs to be made aware of the emptying change at runtime as well, otherwise the setting doesn't take effect safely while the array is Started. That backend awareness is the real scope here and is out of scope for 7.4.0

Leaving the branch in place for reference if we pick this up later.

@elibosley elibosley closed this Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

🧹 PR Test Plugin Cleaned Up

The test plugin and associated files for this PR have been removed from the preview environment.


🤖 This comment is automatically generated when a PR is closed without merging.

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