API returns hardcoded UPS data when no UPS is connected
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 113
- Forks
- 22
- Avg merge
- 10h 40m
- Merged PRs (30d)
- 13
Description
Description
The GraphQL API returns hardcoded/fake UPS data when querying upsDevices even when no UPS device is actually connected to the system.
Steps to Reproduce
- Have
apcupsdinstalled but no UPS device connected - Query the
upsDevicesGraphQL endpoint
Expected Behavior
The API should return an empty array [] or indicate that no UPS is available.
Actual Behavior
The API returns:
{
"data": {
"upsDevices": [
{
"id": "ups1",
"name": "My UPS",
"model": "APC Back-UPS Pro 1500",
"status": "COMMLOST",
"battery": {
"chargeLevel": 100,
"estimatedRuntime": 3600,
"health": "Good"
},
"power": {
"inputVoltage": 120.5,
"outputVoltage": 120.5,
"loadPercentage": 25
}
}
]
}
}
Impact
Client applications display a phantom UPS card with fake data ("My UPS" / "APC Back-UPS Pro 1500") to users who don't actually have a UPS device connected.
Thank you!
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 searching the TypeScript GraphQL implementation of the upsDevices endpoint and the integration with apcupsd. Reproduce the no-UPS condition, then trace why the sample values such as "My UPS" are returned. Done means the query returns an empty array or clearly indicates that no UPS is available when no device is connected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100