Bug: GraphQL API reports incorrect array state after stopping the array
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 113
- Forks
- 22
- Avg merge
- 10h 40m
- Merged PRs (30d)
- 13
Description
Environment
Unraid OS Version:
7.2.0
Are you using a reverse proxy?
No
Pre-submission Checklist
- [ x] I have verified that my Unraid OS is up to date
- [ x] I have tested this issue by accessing my server directly (not through a reverse proxy)
- [ x] This is not an Unraid Connect related issue (if it is, please submit via the support form instead)
Issue Description
The Unraid GraphQL API reports an incorrect array state after starting and then stopping the array.
After the array is stopped, the API continues returning STARTED for both array.state queries and setState mutations.
Attempting to start the array via the api again results in an error claiming that the array is already started, even though the WebGUI correctly shows the array as stopped.
This appears to be a desynchronization or stale-state issue within the GraphQL API layer.
Steps to Reproduce
-
Reboot or start the Unraid host.
-
Query the array state:
query Array { array { state } }Result:
"STOPPED" -
Start the array using:
mutation Mutation($input: ArrayStateInput!) { array { setState(input: $input) { state } } }Input:
{ "input": { "desiredState": "START" } }Result:
"STARTED"
(Confirm the successful start in the WebGUI before continuing) -
Stop the array using:
{ "input": { "desiredState": "STOP" } }Result still incorrectly returns
"STARTED". -
Querying the array state again also incorrectly returns
"STARTED", while the WebGUI shows the array is stopped. -
Attempting to start the array again results in:
"message": "The array is already STARTED"
Expected Behavior
- The GraphQL API should correctly return
STOPPEDafter the array is stopped. setStatemutations should reflect the actual state of the system.- The API should not report “The array is already STARTED” when the array is in fact stopped.
Actual Behavior
- The API continues returning
STARTEDeven after stopping the array. - The WebGUI shows the correct state, but GraphQL queries and mutations do not.
- Attempts to start the array again fail with an incorrect
"already STARTED"error.
Additional Context
- This issue occurs consistently after each system reboot.
- The WebGUI state is correct, suggesting the issue is limited to the GraphQL API’s internal state or caching mechanism.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the array.state query and array.setState mutation sequence described in the issue, comparing their results with the WebGUI after stopping the array. Trace the GraphQL entry points for array.state and setState to identify where the reported state diverges; done means queries and mutations return STOPPED after stopping and allow a subsequent start.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100