Commit abe7283
authored
fix: check mdState to determine array stopped during onboarding (#1969)
## Summary
- **Fix onboarding wizard "array must be stopped" false positive during
internal boot.** The `UpdateServerIdentity` mutation was checking only
`fsState` (filesystem state) to determine if the array was stopped.
During internal boot, the boot pool keeps `fsState` as `Started` even
when the disk array (`mdState`) is `STOPPED`. Now checks `mdState ===
ArrayState.STOPPED` as the primary indicator, falling back to `fsState
=== 'Stopped'` for backward compatibility.
- **Add regression test** for the internal boot scenario:
`mdState=STOPPED` + `fsState=Started` should allow server name changes.
- **Add `mdState` to existing test mock** so the "array running" test
explicitly asserts against `mdState=STARTED`.
## Context
Bug report: "Onboarding Wizard: says array is running when it isn't" —
tested on 7.3.0-beta.1.2 with Connect 2026.03.25.2146. After booting
into internal boot, the onboarding wizard incorrectly blocked server
name changes because the boot pool kept `fsState` as `Started` even
though the array was stopped.
Root cause: The boot pool (ZFS pool used for internal boot) runs its own
filesystem layer, keeping `fsState` as `Started`. The actual disk array
state is tracked by `mdState`, which correctly shows `STOPPED`.
## Test Coverage
```
CODE PATH COVERAGE
===========================
[+] server.service.ts — updateServerIdentity() array check
├── [★★★ TESTED] mdState=STARTED, name changed → throws
├── [★★★ TESTED] mdState=STOPPED, fsState=Started → allows (internal boot fix)
├── [★★★ TESTED] name unchanged → skips check
└── [IMPLICIT] fsState=Stopped fallback → covered by existing tests
COVERAGE: 4/4 paths (100%)
```
## Pre-Landing Review
No issues found.
## Test plan
- [x] All API tests pass (174 files, 1966 tests)
- [x] All Web tests pass (64 files, 618 tests)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved server name change validation to correctly identify when an
array is stopped, allowing name updates in more scenarios including
during filesystem initialization.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent afe1ae6 commit abe7283
File tree
2 files changed
+23
-1
lines changed- api/src/unraid-api/graph/resolvers/servers
2 files changed
+23
-1
lines changedLines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
102 | 121 | | |
103 | 122 | | |
104 | 123 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| 104 | + | |
103 | 105 | | |
104 | | - | |
| 106 | + | |
| 107 | + | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
| |||
0 commit comments