unraid / unraid/api

Work Intent: preserve disk I/O counters from disks.ini

Open Beginner friendly
#2,086 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
113
Forks
22
Avg merge
10h 40m
Merged PRs (30d)
13

Description

Work intent

Fix the array slot state parser so GraphQL ArrayDisk.numReads and numWrites preserve the non-zero counters already present in disks.ini instead of forcing both fields to 0.

Evidence

  • api/src/store/state-parsers/slots.ts currently maps numErrors from the INI state but hard-codes numReads: 0 and numWrites: 0.
  • api/dev/states/disks.ini contains non-zero read/write counters for active disks.
  • The existing parser snapshot therefore asserts zeros even when its fixture contains non-zero counters.
  • Downstream user report: https://github.com/dinglebear-ai/unraid/issues/396

Planned change

  1. Add a regression assertion proving non-zero fixture counters survive parsing.
  2. Map numReads and numWrites through the same numeric parser used by numErrors.
  3. Update the existing parser snapshot and run the focused API test suite.

This is intentionally scoped to preserving the existing state-file data; it does not change the GraphQL schema or counter semantics.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in api/src/store/state-parsers/slots.ts and compare the disk counter mapping with numErrors. Use the non-zero values in api/dev/states/disks.ini to add a regression assertion, then update the existing parser snapshot and run the focused API test suite. Done means the parsed GraphQL counters retain the fixture values instead of becoming zero.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.