new-counter-demo web UI reports success for failed KubeEdge API responses
- Dominant language
- Go
- Stars
- 269
- Forks
- 174
- PR merge metrics
- No merged PRs in 30d
Description
**What happened**:
The new-counter-demo web UI handlers treat every response without a transport error as successful. If the KubeEdge API returns an HTTP error such as 404 or 500, `GetStatus`, `SetStatus`, `ResetCount`, and `SetCount` still return a successful JSON response to the browser.
**What I expected to happen**:
The web UI should detect non-2xx upstream responses and report an upstream failure instead of claiming the requested operation succeeded.
**How to reproduce it (as minimally and precisely as possible)**:
1. Run the web UI while the configured KubeEdge API endpoint returns a non-2xx response.
2. Call one of the counter status or mutation endpoints.
3. Observe that the web UI returns HTTP 200 with `success: true` or a status value.
A focused test covers the shared 2xx status classification used by all handlers.
**Anything else we need to know?**:
The change only validates the upstream status code and leaves successful response decoding and payloads unchanged.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.